Questions tagged as 'javascript'

1
answer

Retrieve all checked checkboxes

I have this code that returns a list of the bank with a checkbox next to each, however when I send it via post it only takes the last one marked and not all: Example with vardump where I marked all: array(2) { ["seriais"]=> string(10) "3...
asked by 25.04.2017 / 16:42
1
answer

How to display an image in the marker information window?

When you click on a marker created with the Google Maps API, you can add an info window, which is what the code below does: google.maps.event.addListener(marker, 'click', (function(marker, i) { return function() { infowindow.s...
asked by 27.04.2017 / 16:34
1
answer

Relocate elements in the DOM

How do I remove an element from its position and reallocate it in the DOM? For example: in a <ul> , bring the last <li> to the top / first position. I saw this in jQuery, with the function appendTo() , and...
asked by 22.04.2017 / 02:45
1
answer

Read Json in PHP?

I have the following code in my PHP : <?php $url = "https://api.cartolafc.globo.com/mercado/destaques"; $response = file_get_contents($url); $jogadores = json_decode($response,true); It should return the file json ,...
asked by 27.04.2017 / 01:07
1
answer

Array inside an object, what is the correct syntax?

I'm creating a personal account manager. I need to do this with localstorage. Here I am trying to assemble an object with all the debits of a category (in this case the category is bradesco). { "nameCategory": "Bradesco", "arrayDebits": {...
asked by 01.05.2017 / 19:53
3
answers

Table showing undefined that does not exist

I have a javascript generate a PivotTable. Looking at Stack Overflow I looked for methods to print a report from this table. In my case, when the user clicks Imprimir tabela opens a page with the layout of the report table,...
asked by 17.07.2017 / 18:23
1
answer

What is the correct way to do calculations [duplicate]

I'm doing a function of product calculations. In the following scenarios: User can add User can give discount (discount on value + addition) User can give partner discount (discount on original value) Function example: function ca...
asked by 13.11.2017 / 14:39
2
answers

Create and assign variables in For loop

How to do this logic within a loop FOR ? var G1 = $('#G1').text() var G2 = $('#G2').text() var G3 = $('#G3').text() console.log("NaN") console.log(G1+"\n"+G2+"\n"+G3) console.log(G1+G2+G3) G1 = parseFloat(G1) G2 = parseF...
asked by 16.11.2017 / 17:29
2
answers

How to consume webservice (WSDL) mails with javascript

I would like to use this web-service provided by mail for a small personal project (beginning, only the return address by the CEP): link Is it possible to consume it via javascript (pure or jquery)? The only time I used web-services was...
asked by 15.11.2017 / 20:20
1
answer

Regex to wrap console.log expression in eclipse find / replace

I'm trying to wrap all console.log(); of my code with condicional if(showLog) { } . I was learning regex and found that I was able to select all console.log() expressions including those separated in several lines by eclipse...
asked by 17.03.2017 / 23:58