Questions tagged as 'javascript'

3
answers

How to fill a numeric field like in internet banking (from right to left)?

In ATMs and internet banking websites there are numeric fields that when you type they are filled from right to left, increasing the number as you type, for example: +-----+--------------+ |tecla|valor do campo| +-----+--------------+ | |...
asked by 13.01.2014 / 18:27
3
answers

Match php variable to a javascript variable

I'm trying to do something like this: <script type="text/javascript"> function guardar_alteracoes(){ <?php $nome = ?>$('#nome').val();<?php; ?> } </script> That is, I want to giv...
asked by 11.07.2014 / 15:16
3
answers

How to delete duplicate spaces in a string?

I have the following string : var str = "00000.00000 111111111.111111111111 33333333" I need to remove the extra spaces for it to be like this (only with 1 space): var str = "00000.00000 111111111.111111111111 33333333" How do I pro...
asked by 25.05.2014 / 02:14
3
answers

Doubt about the responsibility of a get ()

Is it acceptable to have a getter method that gets a parameter to be able to have a return variance? Example: getAllNome("M"); <- retorna tudo que for masculino. getAllNome("F"); <- retorna tudo que for feminino. getAllNome(); <- re...
asked by 28.03.2014 / 21:12
4
answers

How to validate CPF on client side with script?

I'm working with a CPF validation in my controller , but I need to validate when the client exits the input of the CPF and then return a message advising when the CPF is incorrect, alert or something similar. I tried to do somethin...
asked by 20.02.2015 / 01:48
2
answers

What does the "=" operator mean?

I was seeing some solutions in JavaScript and in one case I saw this command line: return args.reduce((s, v) => s + v, 0); . But I do not know what the => operator means. What's his role?     
asked by 21.02.2016 / 01:09
4
answers

How useful is the Exclamation Point (!) before declaring functions in Javascript?

I was reading a manual, and was asked to start the functions like this: !function (){ }(); This exclamation point appeared. What is the purpose of it?     
asked by 06.10.2016 / 20:27
3
answers

How exactly does Javascript return

I wanted to know how it works exactly where it needs to be used within some scope like if etc.     
asked by 13.02.2014 / 16:53
3
answers

Random number without repetition

I made a few attempts to do a function that would return random numbers that did not repeat, I made a few attempts but none succeeded, if they can show me a function that does this, I thank you.     
asked by 23.03.2014 / 23:48
1
answer

Display many elements in the DOM can affect performance?

I really like using libraries as Vue and AngularJs and my favorite implementation was Infinite Scroll (or demand-driven loading). I mean, I initially load 15 records via ajax. If the user scrolls the page, loads another 15, and s...
asked by 13.08.2018 / 20:41