Questions tagged as 'javascript'

2
answers

How to add value to the variable in jQuery?

I have a variable x that is written on the screen with initial value 0; I want each click of a button (be input or button same) in the HTML file, the value of that variable to be added 1; When added, I want the variable...
asked by 09.05.2015 / 03:18
1
answer

Sort decimal notes

I am ordering a related json in notes in undescore.js {8.0 , 8,5 , 5,5 } var asc = _.sortBy(oper, function(num) { return num.nota; }); 8.8 6.0 5.5 10.0 0.0 How do I make him unde...
asked by 31.03.2015 / 17:11
2
answers

How to use the Maximum Common Splitter (GCD) function in BigINT.js

I'm trying to use the GCD library function BigINT.js . But I do not know how, I try to use raw numbers, but it returns 0 In the description says // bigInt GCD(x,y) // return greatest common divisor of bigInts x and y (each with sam...
asked by 15.04.2015 / 00:06
1
answer

Get button value in js

Hello, I'm trying to get the value of a button and put it in a variable, but does not give a way, some help? ///HTML <button class="teclado" id="qTeclado" onClick="clickTeclado(this.value);" value="Q">Q</button> //JS var letra = fu...
asked by 14.06.2018 / 13:15
2
answers

Match in string does not work with 1 character

I have the following obstacle: var myString = "c/q/1"; var match = myString.match(/c\/q\/([a-zA-Z0-9-].+)/); But match returns as null , already in the following example: var myString = "c/q/stringdegrandevalor"; var match =...
asked by 10.06.2018 / 02:34
2
answers

Jquery.get () as asynchronous or synchronous?

I've seen the official documentation here and I do not see that the default value is asynchronous or synchronous, I see no example how to use both (in the second code below). I know this works: $.ajax({ url: url, async: false, data:...
asked by 10.07.2018 / 01:42
3
answers

How to send my login and password via $ .ajax

Hello, I have a link where it opens a modal window (like an "alert") to enter the login and password. I'm using jQuery, the function $ .ajax {} to be more specific. I would like to know how to send my login and password in the header. What kind...
asked by 13.06.2014 / 00:31
1
answer

JavaScript function that checks if textarea scroll has been moved

How to do a JavaScript function that verifies that the scroll of a textarea (this textarea has a responsibility term) has been moved. If the user moves the scroll, enable a div with the continuation of a registration form. Follow th...
asked by 04.06.2014 / 16:30
2
answers

How to add javascript files according to the viewport / device?

I'm using the script skrollr.js on a website and when opening it on mobile the scroll bar is not working (it's like if the touch of the cell phone was blocked). I was wondering how to disable scripts when the user accesses cell phones, since I...
asked by 27.06.2014 / 22:36
1
answer

Is there any way to detect that an attribute has changed in HTML?

I would like to know if you have a javascript check if an attribute of an element has been changed or not. For example: If I have a input , I put the required attribute on it, and someone goes there and deletes required of...
asked by 13.02.2015 / 13:37