Questions tagged as 'javascript'

2
answers

What is the difference between new Function and eval?

What is the difference between new Function and eval , since both seem to do the same thing? Example with eval : eval('1 + 1'); // 2 Example with new Function : new Function('', 'return (1+1)')() // 2     
asked by 29.07.2015 / 21:36
1
answer

How does the 'parseFloat ()' function work?

I wanted someone to explain to me how this function works. For example: What's the difference: var valor1 = 50; var valor2 = 40; var result = valor1 + valor2 To: var valor1 = 50; var valor2 = 40; var result = parseFloat(val...
asked by 20.03.2014 / 22:12
2
answers

Format cash value while typing with pure javascript

There are several questions in the OS about formatting currencies, but most of them are not formatted while a number is typed correctly. How can I format the numbers as you type, passing in these cases below? For example (input > output):...
asked by 29.09.2017 / 00:05
3
answers

How to list the variables defined within a scope in JavaScript?

How do I know / list which variables have already been defined within a scope, whether global or local? For example if I set var x, y, z = 10 , the result of a possible command to list the already defined variables should be something l...
asked by 03.05.2014 / 23:22
2
answers

How to show the youngest age between 3 ages with Javascript?

How can I show the youngest age between 3 ages in javascript? <html> <head> <title> </title> <script type="text/javascript"> var idade1, idade2, idade3 ; idade1 = prompt("Digite...
asked by 14.10.2016 / 16:59
2
answers

CSS or JQuery for animation

When it comes to animation, which one should I use? Which is the lightest? Is it possible to do the same animations in either one?     
asked by 21.02.2015 / 19:29
3
answers

Create markup with predefined symbols

I did not know how to choose a specific title in the face of my doubt, so it was this very vague way. I've been trying to do the following for a while: Assuming I have <p> : <p>Olá, $está tudo$ bem?</p> I ne...
asked by 15.11.2015 / 23:05
1
answer

Div Can Be Dragged

I would like to allow users to move some things from my site. Of the type, the user could drag the menu somewhere else to better position the reading.     
asked by 17.05.2015 / 00:45
2
answers

How can I get the first element of each parent element?

I have a structure like this: <div class="container"> <span class="iconset"></span> <!-- primeiro elemento --> <span class="iconset"></span> </div> <div class="container"> <span cl...
asked by 24.12.2013 / 20:12
1
answer

What is the correct use of the "in" operator, in javascript?

This code does not return anything, why? I'm running in event "window.onload": if(innerHeight in window){ console.log('true'); } I had used the operator again and again, and it worked, but now it came to me ... And then, can anyone hel...
asked by 15.02.2017 / 07:35