Questions tagged as 'javascript'

4
answers

Rounding a decimal number to a lower decimal number

Using JavaScript how can I round a decimal number with several decimal places to a number with two decimal places with the lowest decimal number? Example: 44,97714285714286 To 44,97 I have already used the Math.floor but this ro...
asked by 06.08.2015 / 15:38
3
answers

Clear Zip with JavaScript

How to clear the formatting of a ZIP code field in this format: 87.678-000 ? I need to remove the "." and the "-" and return only the numbers. I tried something like that, unfortunately it did not work out. var i = '^[0-9]+$'; var reg...
asked by 23.05.2014 / 18:47
3
answers

How to get only the second class with Jquery?

<td> <input type="radio" value="5" name="Form1a1" class="abobrinha Form1comentarioA" /> </td> I have 2 classes inside in my input radio, in jQuery I would like to select only the last class (which in my case is the second...
asked by 15.07.2015 / 20:41
2
answers

Remove empty positions from an array

I'm passing array via GET to PHP and then sending to the client side (JavaScript). When I get it it looks like this: m_prod = [5,,,,,,,,6,,,,,,]; In other words, it is including a space in the positions that do not contain a v...
asked by 19.11.2014 / 15:47
5
answers

Strange behavior in a possible way of commenting

I have two functions /########### CARREGAR - LANÇAMENTO ###########/ var carregar_parametros=function(){ alert('asd'); } /########### CADASTRAR - LANÇAMENTO ###########/ var cadastrar_parametro=function(){ if($("#lancamento").val()!=''...
asked by 21.05.2014 / 14:55
3
answers

Does jQuery influence the performance of the application?

I personally love and use the jQuery library. Does this library influence the performance of the application?     
asked by 11.03.2015 / 22:44
7
answers

Split () integer with Javascript

Valor = 19.90; MyArray = valor.split("."); The code hangs, integer variable, however, Valor = "19.90"; MyArray = valor.split("."); alert(MyArray[0]) = 19; alert(MyArray[1]) = 90; I would like to know how to use the split int variable,...
asked by 21.03.2014 / 16:41
2
answers

How to know which conditional is giving true?

For example, I have the following if : if(!condicao1 || !condicao2 || !condicao3){ retorno erro com a condiçao que nao existe } When it enters this if I would like to know which of the parameters is missing to return an error...
asked by 04.01.2018 / 02:07
2
answers

How to check if a variable is float, decimal or integer in JavaScript? [duplicate]

I tried with typeof() , but it only returns me if it's a number, string , etc. It would look something like this: var x = 1.2; if (x == inteiro){ alert("x é um inteiro"); }     
asked by 14.11.2015 / 20:28
3
answers

Image Border within Select Radio after choosing an option

I have a virtual store in which it generates the following HTML of a select that has image inside it. I would like to hide the input (ball of the select radio) and display only one border in the image that is selected that will mat...
asked by 03.07.2017 / 17:35