Questions tagged as 'javascript'

1
answer

Show a different video by clicking with javascript on a link generated by php

This is a piece of a website I'm doing. This table shows a series of gym exercises and, in each of the rows of the table, in addition to the basic attributes there is a link to a video that is displayed when you click on the video glyphicon....
asked by 15.01.2017 / 08:35
2
answers

Sum of all the values of an array in JavaScript

I want to do the following program: Web that asks the user for their notes and calculates the average grade for the term To do this I thought I would store all the notes in an array, display them on the screen and then show the average....
asked by 11.06.2018 / 20:41
3
answers

JSON.parse: expected property name or '}' JavaScript

I have this String: [ {'lat':43.4627,'lng':-3.79636,'description':'a'}, {'lat':43.4476,'lng':-3.82948,'description':'b'}, {'lat':43.4228,'lng':-3.82391,'description':'c'} ] And when I try to validate here I get this error:...
asked by 10.05.2018 / 12:52
2
answers

Apply a style to the single pulsed element

I have a problem, I am using jquery, and I need that when I press an element a style is applied, the problem is that all the elements have the same class and I can evaluate it with the event object that I receive the function, but that's only wh...
asked by 15.03.2018 / 01:19
2
answers

get distance based on latitude and longitude

I need to get the distance between two points, as formula is but the data provided by google maps is lat, log and I need the distance in meters var map; function initialize() { var myLatlng = new google.maps.LatLng(41.38,...
asked by 16.03.2018 / 17:52
1
answer

how to take a data from a json object in ajax

I have this code to create a table and insert the data of the type json array: $.ajax({ url: '<?php echo base_url(); ?>index.php/Manager/metricsAdvocates', type: 'post', data: {'sup':sup, 'dateM':dateM}, dataType: 'json...
asked by 22.03.2018 / 18:26
2
answers

Question about if inside a class in javascript

I wanted to do that if you have a child it is true to show me something, to do it but not inside a class and if it is false tell me that you do not have children, I made this churro but it does not go, this._hijos is true you should enter the if...
asked by 14.01.2018 / 13:12
4
answers

How to get the answer of an asynchronous call (AJAX) out of it?

I currently have this function: function devuelveButaca(posicion){ var array = posicion.split('_'); var row = array[0]; var column = array[1]; var planta = $('#plantaField').val(); var resultado = ""; $.ajax({ t...
asked by 22.12.2015 / 14:03
3
answers

methods within the objects of the function class in javascript

I'm trying to learn an HTML5 framework for videogame development, called phaser, so I'm in the tutorial of here , where it says 'Loading Assets' there is a preload function that loads the images or assets commonly called 'assets' of the...
asked by 24.02.2018 / 01:47
1
answer

Manipulate DOM with Object Oriented Programming

I am trying to implement the OOP to manipulate the DOM but there are certain things that I do not know where to place, for example the addEventListeners, a specific case that I am facing is, I have created an object that works with some elements...
asked by 31.01.2018 / 03:55