Questions tagged as 'javascript'

1
answer

How can I calculate the center of a polygon with the Google Maps API [closed]

How can I calculate the center of a polygon (Polygon) with the Google Maps API?     
asked by 12.05.2018 / 00:48
1
answer

How to add the elements of Array?

Hi, I am trying to create a program that adds the multiples of 3 and 5 that are between 0 and 10. Well, I do not know what I'm doing wrong that the sum gives me 33, when it should be 23. Do you see the error in my code ...? Thanks. funct...
asked by 14.05.2018 / 00:43
2
answers

javascript replace regex

I need to make a replace in a whole string with a format similar to the following: var miRegExp = "^[0-9]+$"; var miString = $("input").val(); miString = miString.replace(new RegExp(miRegExp)+ /g, ''); The objective is to replace all the ch...
asked by 11.05.2018 / 17:15
2
answers

Sort object by its indices in JavaScript

How can I sort an object by its indexes in JavaScript, with an object similar to the following {ave:2,gato:3,burro:7,caballo:3,hipopotamo:5,elefante:8} How can I make the object look like this? {ave:2,burro:7,caballo:3,elefante:8,gato:7,h...
asked by 30.09.2018 / 19:03
1
answer

How to select several elements whose ID contains a word

Hello with javascript I'm doing a function where I want to hide several elements, the problem is that if I use getElementById I can only select a single element, and I would like to hide several that have a similar ID; example, 'checkbox1', 'che...
asked by 27.04.2018 / 17:33
2
answers

Fix code to take local date and time

I am doing a query with javascript to be able to get the local date and time of my laptop but my problem is that it takes me the month as 4 and not 04 which is the one I need, please could you help me, thank you very much and here I show...
asked by 28.04.2018 / 17:33
3
answers

How to know if it is empty or null on field by ID in Javascript

I have this: <select id="division" multiple="multiple" title="Equipos seleccionados" style="width:143px;height:125px;overflow:scroll;"> <option value="1" title="Bundesliga">Bundesliga</option> </select> I'm doing thi...
asked by 24.04.2018 / 15:43
1
answer

Modify css of element within iframe

I have an iframe with id="myframe" that has another source file from the same server <iframe id="myframe" src="referencia.php"> </iframe> In reference.php I have a div with id="box" that I want that when it opens directly the p...
asked by 10.03.2018 / 18:14
1
answer

How to show only a range of values on the highcharts Y axis

I'm doing some graphics in highcharts with double Y axis, and it shows me the values in the following way: but what happens is that as the values of the Y axis (right side) has minimal differences, which are between 100 and 99, and you...
asked by 23.10.2018 / 00:33
1
answer

Insert a label to all the labels that have a class in specific

I want to insert a li tag into all ul that have the class or id 'father' . And that ends something like this: <ul id='padre'> <li id='hijo'></li> <li id='hijo'></li> </ul> <ul id='padre'&g...
asked by 31.10.2018 / 17:00