Questions tagged as 'javascript'

5
answers

Transforming a JSON information into a variable

I'm calling a function in node.js and it returns a JSON: { "pair": "BTCBRL", "last": 2280.0, "high": 2306.0, "low": 2205.0, "vol": 113.17267938, "vol_brl": 255658.20705113, "buy": 2263.0, "sell": 2279.77 } I would like to us...
asked by 12.01.2017 / 14:51
3
answers

How do objects created following singleton work?

I would like to understand how objects created following the singleton design pattern work in javascript. My main doubts are about the methods and attributes of this object, where and how to create them, and where and how to access them. I...
asked by 24.12.2015 / 19:23
1
answer

How does library import work in JavaScript?

In programming languages such as Java, C # and C, when we want to use some command or function we must include the library where it contains the commands we want or the classes if it is an object oriented language, see examples: Class Scann...
asked by 08.05.2016 / 22:43
3
answers

Inaccurate result in calculation with broken numbers

Problem Test on the consoles of your browsers: 1067.11-1000 = 67.1099999999999 The correct one would be 67.11 Could anyone explain this to me? And how do I resolve this?
asked by 13.02.2014 / 15:23
6
answers

Input type="password" with the eye to show password

I need to put a <input type="password"> with that password reveal eye, however it has to work as follows: User clicks on eye and loosens the characters again. Here is a sample photo:     
asked by 04.12.2015 / 16:56
13
answers

Phone Mask using jQuery Mask Plugin

I need to change the position of the "-" in the mask. <label for="telefone" >Telefone</label> <input style="width:25%; margin-right:25% " type="tel" name="telefone" id="telefone" pattern="\([0-9]{2}\)[\s][0-9]{4}-[0-9]{4,5}" /&g...
asked by 28.11.2014 / 13:18
3
answers

Why can I create two functions with the same JavaScript signature?

I am having doubts about a certain issue in Javascript, suppose the following scenario: function teste() { console.log("teste1"); } function teste() { console.log("teste2"); } teste(); In this case I realized that my...
asked by 16.03.2017 / 14:47
3
answers

innerHTML VS innerTEXT

What's the difference between using innerHTML and innerText in Javascript? If I want to change the content of TEXT_NODE , which one should I use? For example: <p id="p1">I also wrote a book! Read it <a href="http://eloquentja...
asked by 17.09.2018 / 02:43
3
answers

How is a REGEX Javascript for Tracking Code Posts (AZ123456789AZ)

I need a Regex for the default A-Z 1-9 A-Z validating AZ123456789AZ I've tried /^[[A-Z]{2}[1-9]{9}[A-Z]{2}]/$     
asked by 20.09.2018 / 20:06
7
answers

Understanding the JSON file

I have code similar to this in JSFiddle . On my WAMP server at home I tried to work with JSON (JSFiddle does not contain the JSON file to test). In a question I asked about how to insert data into a database with jQuery answered me that...
asked by 30.01.2014 / 19:14