Questions tagged as 'javascript'

1
answer

Length of content returning incorrect value

I have this code to check if the size of the user input conforms to some parameters, but the size it returns is always -1 the size of the input content, would it be the case to convert to int and add 1? $("input").keydown(function() { c...
asked by 19.04.2017 / 14:42
3
answers

avoid submitting a form with barcode reader

Well I have the following form: <form name="produto" method="post" action="cadastra.php"> <input name="cod" type='text'> <button type='submit'>FINALIZAR</button> </form> Good Whenever I use the barcode re...
asked by 17.05.2017 / 18:13
1
answer

Highlight day and week in Calendar

How to highlight (stylize) the day of the month and the week ? The function below was the simplest one I got on the Web that allows me to understand at least part of the code. I need to know 1) how to apply CSS to the current day and 2)...
asked by 27.03.2015 / 05:05
2
answers

Group json date for a given object

I have a list: var dataString='[ { "category" : "Search Engines", "hits" : 5, "bytes" : 50189 }, { "category" : "Content Server", "hits" : 1, "bytes" : 17308 }, { "category" : "Content Server", "hits" : 1, "bytes" : 47412 }, { "category"...
asked by 02.04.2015 / 01:40
2
answers

Replace all after first blank

I have a variable that can store compound words, as in the example below. I would like help with the replace() method in order to replace everything after the 1st (first) whitespace , regardless of content and length. So the value of th...
asked by 15.03.2015 / 04:03
1
answer

AJAX Request Error - success does not work

Good afternoon guys, I have the following AJAX request: $(document).ready(function () { $.ajax({ url: "/membros.aspx/populaGridMembros", type: "POST", dataType: "json", contentType: "application...
asked by 17.01.2015 / 17:30
2
answers

Detect which link was clicked

I'm trying to add some songs in a playlist , but I can not tell which song was clicked to add. HTML <div class='album-musicas'> <a href='#' id='add-musica-playlist-link' class='addMusicaPlaylistLink'> <input type='hi...
asked by 07.11.2014 / 19:45
3
answers

What is the advantage of using function (window, document, undefined)

I've noticed for a long time that many libraries are using something like: (function(window, document, undefined){ //exemplo de script console.log(window, document); })(window, document); or (function(window, document, undefined){...
asked by 28.12.2014 / 18:23
1
answer

Add instead of concatenating number to the value of an input

I do not know if I understand, but in the javascript code below, I want every time I click the button, a sum occurs, but I can only concatenate. Thanks! function somar(){ document.getElementById("valorSomado").value += 80; } <but...
asked by 29.10.2016 / 19:17
3
answers

How do I only allow numbers and a special character in javascript?

I have a validation problem on the client-side in case I am trying to validate the CEP field, I need it to only accept the person's 9 zip code numbers and the - who can help thank you right away. This is part of the code: if(isNaN(...
asked by 02.11.2016 / 01:06