Questions tagged as 'javascript'

1
answer

How to group values of a json

I have a JSON similar to this: [ { "id": 459, "razao_social": "Testosvaldo de Testousa", "cidade": "Testolandia", }, { "id": 472, "razao_social": "teste trr", "cidade": "Belo Horizont...
asked by 04.09.2018 / 16:56
2
answers

How do I set an element via jQuery / Javascript?

   I'm doing an integration with a social plugin and am having a problem. My code: linkedin : function(self){ var sett = self.options.buttons.linkedin; $(self.element).find('.buttons').append('<div class="button linkedin"><s...
asked by 20.12.2014 / 00:38
2
answers

Why is Ajax only working the first time?

I have a table with some values stored in it. In this table I also have two buttons where I can hide the values, leaving only the name of the table and another button that filters the information I want. My problem is that the filter button i...
asked by 15.01.2015 / 13:14
2
answers

How to get object position (index)

How to get the position of the object that was found in $ .inArray ()? var obj = [ { cidade : [ { nome : "Maringá" , uf : "PR" , } , { nome :...
asked by 10.12.2014 / 14:27
1
answer

How to get the value found by indexOf?

I'm having a code where I pass a value and I need to check if this value exists within array , so I use indexOf . What I would like is to get the value that indexOf finds, for example: org = 3; var array_t = [1,2,3,4,5]; re...
asked by 21.11.2014 / 17:10
3
answers

Simple multiplication in JavaScript with decimal

As seen in the Simple JavaScript multiplication , I was able to multiply the response.rows [0] .elements [0] .distance.text value by x30 in the Maps script v3. The final code looks like this: <!DOCTYPE html> <head><ti...
asked by 29.12.2014 / 19:40
3
answers

Receive result of an ajax as return

Within the following scenario: funcao1 = function() { $.ajax({ success: function(data) { return data; } }); } funcao2 = function() { var dados = funcao1(); } Is it possible to re...
asked by 08.11.2018 / 19:08
2
answers

Mask for telephone field

How can you mask in a phone input only to accept numbers and already enter the formatting (xx) xxxxx-xxxx     
asked by 09.05.2018 / 20:51
4
answers

how to calculate the number of days with input of type date? [duplicate]

My question is: I have two input of type date. What I want to do in Javascript is to calculate the amount of days from the first to the second, ie if the person put dateEnter = day 06/02/2018 in the first input and dataSaida = 06/06/2018...
asked by 02.06.2018 / 06:47
3
answers

Optimize how to remove element classes

I have a sequence of rows to remove classes from multiple elements. Would there be a more sophisticated way, perhaps with less code to accomplish the same as the code below? $(document).find('.control-corpo').removeClass('control-corpo');...
asked by 26.05.2018 / 21:53