Questions tagged as 'javascript'

4
answers

Know if a variable has no data

I have a modal to which I pass a variable by javascript, the fact is that this variable has no way of contouring when it is empty or has data. The step of variable data-url to which I assign convenio.url_also does it well, since from the modal i...
asked by 09.03.2018 / 17:54
2
answers

Detect if you click inside a Div

I am looking for a way to detect if click has been made within a div regardless of the content that is inside the div in question. $(document).ready(function(){ $('#armaz *').on('click', function() { alert($(this).prop('id'...
asked by 14.07.2017 / 05:52
2
answers

Add styles with js in the DOM

I am trying to add css to all the elements with the class menu-icon and menu-title, but when doing so with js, I only add the css to the first element. I mean, I have about 10 elements with that label but it only adds the style to the first one...
asked by 06.11.2018 / 09:02
2
answers

Format a string or number using Javascript

I have an application that consumes API . I have no control over that API , I can only consume it. The API returns in JSON format a name, latitude and longitude. The problem is that due to a problem, the latitude and...
asked by 13.02.2017 / 11:24
1
answer

How can I validate with jquery if a field only has letters [closed]

How can I validate a field that only has letters but with jquery? Thanks for your help.     
asked by 03.01.2018 / 00:29
2
answers

Remove duplicate

I have the following code in JavaScript and I would like to know where the error lies, I need to print non-repeated values or if you know some more effective way: var t1 = 2; var t2 = 2; var t3 = 3; var t4 = [t1,t2,t3]; var t5 = t4.uniq...
asked by 25.01.2018 / 18:44
4
answers

How to use ArrayList in JavaScript

I need to use a ArrayList in JavaScript to manipulate data and pass it through ajax. For example: Set what type of transport it is, make, year and color. eg var data = {"Automobile", "Nissan", "2010", "Red"} Problem: What I n...
asked by 28.01.2018 / 05:46
5
answers

Passing variables from a javascript to an html

Hi, I have the following jquery script: <script type="text/javascript"> $(document).ready(function(){ $("a").on("click", function() { var img = $(this).children('img').attr('src'); var p = $(this).child...
asked by 23.01.2018 / 11:12
2
answers

Shoot an event after several events. [closed]

Suppose you have several ajax requests and you want to trigger an event only when all of them are completed. Is there any elegant way in JQuery to do this?     
asked by 06.06.2017 / 16:55
1
answer

Convert dd-mm-YYYY HH :: mm: ss to date in javascript [duplicate]

How can I convert a date in string dd-mm-YYYY HH :: mm: ss to the javascript date and inversely the conversion of the javascript date to a string date. So far I have this working: fech = $("#fechaHoraInicioAgenda").val().split("-"); var...
asked by 27.04.2017 / 19:28