Questions tagged as 'javascript'

2
answers

Function does not recognize checkbox.checked

I have the following function: function alteraSaldo(item){ saldo = parseInt($('#saldo').val()); campo = $('#'+item); if (campo.checked == true){ alert('sim'); saldo = saldo - parseInt(campo.data("valor")); }else{ alert('nao');...
asked by 04.08.2018 / 17:08
0
answers

How to convert a Request XMLHttpRequest [duplicate]

Good afternoon. I am querying a file of type Json, when I make the request it returns in a String format, such as to make it come in a JSON format to be manipulative. reqListener() { return new Promise((resolve, reject) => {...
asked by 10.07.2018 / 17:20
0
answers

Element without properties

See the following code snippet below: var element = document.getElementById('myDiv'); console.log('element: ', element); console.log('has tagName property: ', element.hasOwnProperty('tagName')); console.log('all properties: ', Objec...
asked by 06.07.2018 / 02:37
1
answer

Tooltip does not disappear when the button is clicked

The tooltip usually appears when I hover the mouse over the button, but when I click the button and drag the mouse out of the button the tooltip gets stuck. <button type="button" class="btn btn-default fa fa-angle-left fa-2x" data-toggle="t...
asked by 06.07.2018 / 16:52
1
answer

PHP - Multiple image upload does not work

I'm implementing a Drag and Drop scheme in my project, as in the example below: var holder = document.getElementById('holder'), tests = { filereader: typeof FileReader != 'undefined', dnd: 'draggable' in document.createE...
asked by 05.07.2018 / 02:36
2
answers

Format number for only 2 digits

I have a script that returns: 4.499999999999999 But I wanted it to return only 4.4 or round to 4.5, so I do not want it to be more than 1 digit after the comma, how to do it?     
asked by 19.03.2015 / 22:41
1
answer

How to apply css to an open page with window.open?

I have a page that I need to print only one part of, I used window.open followed by a window.print for this, except that the output does not come out in the expected format, it's a form and it should be printed as it is in a css file I have, how...
asked by 04.07.2018 / 21:32
0
answers

Send a jquery variable via ajax to PHP

I'm trying to send data from a table via Ajax to PHP. I'm doing this by transforming the table into JSON and thus sending via Ajax to PHP. The scritp looks like this: <script type="text/javascript"> $('#converter-tabela').click( func...
asked by 04.07.2018 / 17:29
1
answer

Browse fields input ng-repeat AngularJS

/* Retorna produtos banco de dados */ $scope.produtos = []; var carregaProduto = function () { $http.get("app/models/retornaProduto.php").then(function (response) { $scope.produtos = response.data; });...
asked by 03.07.2018 / 01:17
0
answers

Function $ even without jQuery

I have a project in angular2 v6, I'm doing the same without jquery and lodash, but when I type $ ('body') on the console it returns as if I had used jquery. When I type $ it shows.    ƒ $ (selector, [startNode]) {[Command Line API]} Do...
asked by 02.07.2018 / 19:37