Questions tagged as 'javascript'

1
answer

Instructions that depend on variables coming from "for" loop, need to be executed in callback?

For example: var soma = 0; for(var i = 0; i < 100; i++){ soma += i; } if(soma < 500){ console.log('Soma é menor que 500'); } Since the if condition depends on the variable b , which comes from the for loop, the...
asked by 01.03.2017 / 10:46
1
answer

Building an Array with the date range

I'll get two dates, Example: 10/01/2017, 10/31/2017. How can I create an array with every day between those dates. Array = ["01/10/2017", "02/10/2017", "03/10/2017", ... ,"31/10/2017"]     
asked by 16.10.2017 / 14:08
2
answers

How to add the animation to the top of the page using the easings library?

The search for effects to add on a button "Back to Top" found this jQuery library that uses CSS transition , SCSS and jQuery itself to make animations, but I could not add them to the top button, does anyone know? Or do you know of another of t...
asked by 13.10.2017 / 15:57
2
answers

Function .ajaxComplete () executes multiple times

I want to add this function after a .ajaxComplete, but every time an ajax happens, this bolt executes a number of times equal to the amount of ajax that happened. For example, if I click the button in the .chPlus class the first time, the con...
asked by 20.10.2017 / 20:12
3
answers

How to find 2 or more words in a text using jQuery?

Hello, I'm doing a search field where it brings the data of an XML. However, it is only bringing if I type the name in the right order, for example: in xml, the person's name is "Manoel da Silva", but if I only write "Manoel Silva" in the sea...
asked by 10.09.2015 / 20:47
2
answers

How to do animation in quicksort with canvas

I tried to redraw the canvas every time it swaps, but it first renders everything and then draws. I would like every Swap to redraw the canvas with the object information. <!DOCTYPE html> <html> <head> <...
asked by 22.10.2017 / 21:21
2
answers

How to remove the characters from a certain point with Jquery?

How do I remove everything I have before ? in this string smartphones?marca=3 or celular?marca=4 displaying only what is after the " ? " question mark with Jquery or Javascript?     
asked by 15.09.2015 / 19:54
2
answers

jquery form mask

I'm trying to validate the form field using jquery, if the size is greater than the number of cpf it puts the cnpj mask in that same field var tamanho = $('.cpfcnpj').length; if (tamanho == 11){ $(".cpfcnpj").mask('000.000.000-00'...
asked by 19.11.2015 / 08:49
2
answers

How to clone an object in javascript? [duplicate]

I'm trying to pass one object per parameter of a function, but I do not want that object to change. For this I want to pass a clone parameter. Because in javascript, by the tests I did, the object is always passed by reference. Example:...
asked by 26.11.2015 / 18:00
1
answer

How do you position a moving div to be automatically saved?

I've developed a widget for my project and now I need it to be saved when I move it. Example: Initial position of widget 80px x 120px , after move it, initial position of widget 210px x 300px . I hope my doubt is...
asked by 04.12.2015 / 21:16