Questions tagged as 'javascript'

3
answers

Function that converts this string to json

I have string in the following format: "a=123 b="ABC" c="Olá Mundo!"" I need to create a function that transforms this string into this json: { a : 123, b : "ABC", c : "Olá Mundo!" } I think it has a bit of regular e...
asked by 10.06.2016 / 02:16
4
answers

Regular expression to accept only numbers and a ","

How can I make an expression or function to get only numbers and commas, which the user informs. I want to get a product pricing form. If the user types a letter or something other than the comma, it will not be validated. I have the example...
asked by 17.10.2015 / 17:48
2
answers

How to restrict access to routes in angularjs?

How do I restrict access on some routes, and allows logged-in users to access your content on Angulajs.     
asked by 25.08.2015 / 10:31
2
answers

.after () jquery in JS Pure?

In jquery: $( "#main article:nth-child(3)" ).after( "<div style='clear:both;/>" ); How would you look in pure JS?     
asked by 06.11.2015 / 07:05
3
answers

How to convert a String to Int in Javascript?

HTML5: <!DOCTYPE html> <html> <head> <title>JSTest</title> <meta charset="UTF-8"> <script src="JSource.js"></script> </head> <body> <input type="number" id="myinput...
asked by 11.06.2016 / 01:34
5
answers

Changing text in several different places on the HTML page

I'm thinking of developing a i18n system for an application. My idea is : there is a text # i18n_label_name somewhere on the page and # i18n_label_contact elsewhere. > Question : What is the most performative way to scan the whole p...
asked by 12.11.2015 / 12:51
2
answers
2
answers

Add real Brazilian currency div

The script is adding, but only numbers. I would like to have the values with periods and commas. For example: 1,000.00 + 100.00 = 1.100.00 Does anyone give this strength there? Follow the code below: <script src="jquery_somar.js"&g...
asked by 14.08.2016 / 05:09
4
answers

How to correctly return the calculation values with decimals in javascript?

I have following code someone could help as would be solution for that. var resultado =(parseFloat(126,79) + parseFloat(237,00)).toFixed(2); javascript result = 363.00 Correct value = 363.79     
asked by 16.11.2016 / 19:30
3
answers

Formatting numbers with jQuery

Hello, I have an array that is returned through an AJAX request and I want to format the numbers for each of these keys as follows:    Example: Default values -> 2569 -> 192544694 How would you like them to be formatted...
asked by 29.12.2016 / 21:47