Questions tagged as 'javascript'

2
answers

Ajax request in ES6 constructor

How do I make a Ajax request in my constructor and assign the values of this request to my attributes? So far it's like this and it's not working, I'm returning 2 jsons ... on console.log the attributes are empty, ie the...
asked by 01.05.2017 / 04:32
3
answers

Displaying checkbox value disabled

Hello, I created a very simple system where I enable 10 values of 25 and I want it to display with an innerHTML those that are disabled, I made this system with checkbox and I was putting them in variables and then doing it one by one . I'm a...
asked by 05.10.2016 / 14:25
2
answers

Events do not work after being fired once

I'm doing a CRUD with JS and localStorage. However, when I do an inclusion or an exclusion, when trying to click the buttons, the events are no longer triggered. Can you explain why? var tblVariacoes = localStorage.getItem('variacoes'); var...
asked by 11.10.2016 / 03:20
2
answers

JavaScript regular expression does not work inside the form tag

function celular(){var celular=document.getElementById("celular").value; var ExpReg = /^[0-9]{11}$/; if(ExpReg.test(celular)){ alert("Sim passou no teste."); return true; } alert("Não passou no teste."); return false;} funciona:<input type="t...
asked by 12.10.2016 / 04:49
3
answers

I can not close div using hide jquery

I'm starting in jQuery and I created a script in which when I click the div it displays the content. So far so good, but when you click on text close the jquery hide is not working. jQuery(function(){ //jQuery('#showall').click(function()...
asked by 13.10.2016 / 16:39
3
answers

How do I assign "selected" to a dynamic option?

I'm populating a SELECT from a JSON received via AJAX as follows: $.each(parsedData, function(i, produto) { $('select#produtos').append( $('<option></option>').val(produto.cod_produto).html(produto....
asked by 05.07.2016 / 20:12
2
answers

Should I validate data in javascript and php? [duplicate]

I have a file that sends some data to another page with ajax . These data are mostly numbers, and are not stored anywhere. I just get some data in inputs and send it to the file php with ajax , and then return these calcul...
asked by 09.07.2016 / 14:15
2
answers

Pagination with AngularJS and WebAPI

I need to make a pagination using AngularJS . Well, I made a controller to popular Table HTML . This is working now. My next step will be to page this table. I took an example on the internet, but the example the guy makes a for 1 to...
asked by 12.07.2016 / 18:57
3
answers

Display different contents when you select one of the buttons

How can I make% change with a push of a button? in case I have 3 buttons, the first one will cause the first div to be displayed, the second to show the second div and the third to make the third div appear. Something similar to...
asked by 10.11.2016 / 19:57
2
answers

removeClass with jQuery

I use the following code in jQuery to remove a class from a TR of a table. $("tr").removeClass('text-white'); It works fine, but it's removing the tr from all tables, I want to know how to remove only from the class="dados"...
asked by 03.11.2016 / 13:14