Questions tagged as 'javascript'

2
answers

How to sort object vector by checking for an attribute?

I can sort a simple list using the sort method See: var distances = [15, 18, 27, 29, 5, 3] distances.sort(function(a, b){ return a-b; }); console.log(distances); But I would like to sort a list of objects based on...
asked by 26.05.2017 / 22:26
3
answers

receive two houses after the comma

I need to receive a cash value and am only getting a house after the comma. example 75.50 I get 7.5 and 7 I need to receive 7.00; I'm using Jquery;     
asked by 18.05.2017 / 22:11
1
answer

Help with react native

I'm having an annoying error installing react native: ~/MyApp $ react-native run-android Scanning 555 folders for symlinks in /home/henrique/MyApp/node_modules (4ms) Starting JS server... Building and installing the app on the device (cd andro...
asked by 23.05.2017 / 01:04
3
answers

What is the difference between .on ('input') / .on ('paste') / .on ('change')?

I was trying to do a validation but with .on ('input') it works better than .on ('paste') a timeout for it to work), can someone explain the difference between the two? Here is my code to illustrate the question: paste $(this).on("pas...
asked by 25.08.2017 / 16:56
1
answer

Pure Javascript Portfolio Filter

I'm trying to quit jQuery, but I found a difficulty now, make a Filter, style those found in Portfolio, but with JS Pure, just found in jQuery or CSS3 (on the internet), nothing with JS Pure, someone Could you help me? I can not really do anythi...
asked by 18.08.2017 / 16:58
3
answers

PHP - Problem with string accentuation in a string

I'm having problem with looping in strings with special characters, could anyone help me? Follow the example: $letras = 'nós'; $numero = strlen($letras); for($j = 0; $j < $numero; $j++){ echo $letras[$j]."-"; } The result of the a...
asked by 02.06.2017 / 16:46
3
answers

Disable input sequence with jQuery

Well in the example I posted I can disable input valor1 , vendedor1 and supervisor1 by checking the recalcular1 option. The problem is that I have a form with several input, and to avoid a very large code I wanted t...
asked by 10.07.2017 / 19:08
1
answer

Access composite word object, $ .each, Javascript?

I have a problem accessing an object that has white space in the name. I used json encode in php and I get the answer from ajax: {Seguranca: 0, Saude Publica: 4, Transportes: 0, Outros: 0, Urbanizacao: 0, …} I use each to iterate: $.ea...
asked by 11.09.2017 / 22:13
3
answers

Change 'id' from Form element javascript or jquery

I need to change the id of a form in HTML with javascript at runtime. I'm trying with JQuery and Javascript, but it's not working. jQuery(this).prev("form").attr("form", "form_modulo"); or document.getElementById('form').id = 'form...
asked by 10.07.2017 / 03:12
2
answers

Perform multiple GET with XMLHttpRequest

How do I make the XMLHttpRequest send multiple requests using a list with pure js, eg: I have the following list of names Fernando Lucas I want to pick up this list and do a post with one name at a time and display the response of the re...
asked by 08.10.2017 / 12:30