Questions tagged as 'javascript'

4
answers

Creating a bot in JS

I'm developing a bot in javascript where it will insert a value into a field of a website and click 'send'. window.onload = function() { window.open('http://www.google.com', '_self'); document.getElementById('gbqfq').value = 'javascr...
asked by 14.04.2014 / 21:54
1
answer

How do you know the number of "children" in a class?

For example, using for : var children = numero_de_filhos_de_uma_classe_qualquer; for (i = 0; i <= (children); i++){ document.getElementsByClassName("classe")[i]; } HTML <div class="classe" ></div> // Filho Númer...
asked by 11.07.2014 / 20:43
4
answers

Make a regex to remove characters

In a return of a jquery function, the returned date comes in this format. /Date(1401731794773)/ I would like to remove the invalid characters on this date, which are: /Date( and )/ I only need the date (remaining) compon...
asked by 16.06.2014 / 18:29
3
answers

Finding an intermediate value between two variables

I'm developing an algorithm for the game of checkers and I came across a problem, when one piece eats the other, where I need to know the position of the piece that was eaten. According to the image and code below, knowing the value of a...
asked by 01.03.2018 / 01:16
2
answers

Problem converting input text to capital letters

I have input and I want it to only allow capital letters in real time. This code seems to work perfectly. $("#texto").on("input", function(){ $(this).val($(this).val().toUpperCase()); }); But I noticed a bug and I do not know...
asked by 06.04.2018 / 15:10
2
answers

Function Reference

I would like to know why the object's function is referencing the name outside the object, not what's inside the object? what would not be the function to look for the variable that is closest to the scope of the function? const obj = {...
asked by 04.04.2018 / 05:49
5
answers

Make lamp light on and off

I'm studying javascript and I did an exercise where I have an image of a deleted lamp where when I click it it changes the lamp by placing a light, as if it were lighting a lamp, however I'm in doubt I do not know how to do the same change the i...
asked by 29.04.2018 / 23:17
2
answers

What is the difference between using variable and passing direct parameter?

I wanted to know the real difference and between $sql = 'select * from tbl_blablabla'; $result = $connect->prepare(sql); and $result = $connect->prepare('select * from tbl_blabla'); Not only in this specific case, but several oth...
asked by 08.05.2018 / 21:41
2
answers

Disable button after the jQuery click

Well I'm having the following problem. JQuery identifies the data-link tag to retrieve the link and redirect the page. Soon after that the booting has to be disabled. The problem is that clicking the button is disabled and is not redir...
asked by 26.05.2017 / 13:49
2
answers

console.debug is not working in Chrome

I am using the 58.0.3029.110 (64-bit) version of the browser (the last available here when creating this question), and when trying to execute the following code: console.debug("Teste", 1); The result is only: undefined And noth...
asked by 11.05.2017 / 16:39