Questions tagged as 'javascript'

1
answer

How to pass a javascript variable to a php variable?

What I want is for my php variable to get the value of my javascript variable So I get my javascript value:      (function() { var variable="contenido"; alert(variable); })(); </script> So I want to pass it to my php variable...
asked by 22.03.2018 / 00:21
2
answers

"Unexpected token" error when trying to use ECMA2015 module

I am testing the use of the ECMA2015 modules and something will be wrong because I can not use it. My code is as follows: //Archivo libreria.js export {unaFuncion, otraFuncion}; function unaFuncion() { console.log('Escrito desde u...
asked by 15.03.2018 / 01:11
1
answer

Doubt about indexOf () in string

please if you could give me more detail of why the return of each exercise: "Blue Whale".indexOf("Whale",0) // returns 5 "Blue Whale".indexOf("Whale",5) // returns 5 "Blue Whale".indexOf("",9) // returns 9 Thank you.     
asked by 21.03.2018 / 02:52
2
answers

Read Json with ajax with names without quotes

I am looking to read through jquery and ajax an object json from an external server. When making the request, the server returns a supposed json file with the following format: { Status: 'Success', Data:{ 'primero': {...
asked by 04.04.2017 / 18:43
1
answer

generate pause between songs

hi can you tell me how I can do so that when a song ends, the pause starts, each time a song ends, the pause is paused before following the next song <audio src="../estudio/beats/eminem.mp3" autoplay controls id="beat"></audio> <...
asked by 14.04.2017 / 19:25
2
answers

I can not set a width with javascript

Good morning, I'm trying to associate a dynamic width value, because within a div, I have 2 elements, one with fixed width and the other that I want to occupy the remaining space, for this I'm using this script: <script type="text/javasc...
asked by 16.04.2017 / 21:54
1
answer

CSS syntax alerts in ES [closed]

Could an ES subroutine be made to notify me in any way of a CSS syntax error?     
asked by 13.04.2017 / 17:24
1
answer

why does this binary conversion give me an incorrect value in javascript?

I have the following decimal number converter function binario(numero) {  var division = 0;  var binario = [];  do {  division = numero / 2;  if (numero % 2 == 0) {  binario.unshift("1");  } else { ...
asked by 06.05.2017 / 13:32
2
answers

How can I make the screen automatically upload with js? raising the scroll 300px [duplicated]

Good morning; I have a few elements placed in a div, but I need that if you click on any upload the scroll automatically upload to the top of the screen, but can not find a function or any way to achieve this goal. Any ideas? Thanks.   ...
asked by 08.05.2017 / 15:25
2
answers

Why does not it show the values?

I have the following object in javascript, but it does not show me any value, name, age, or purse, what is the error? // El jugador function Jugador(name, edad, dinero) { this.name = name; this.edad = edad; this.dinero = di...
asked by 08.05.2017 / 17:05