Questions tagged as 'javascript'

3
answers

Is it correct to put an event inside another event? [closed]

I have a script in which I am going to add XLS files, once I validate the file format, I close a bootstrap modal and open another modal where it is a confirmation window to see if it is safe to upload that file. This confirmation modality has...
asked by 01.02.2018 / 20:16
4
answers

How to change the appearance of an object when clicking?

I'm doing a minimalist memory game, to practice HTML and CSS code, but as a good beginner, I can not find how when the user clicks on a letter (not the effect: hover) it shows the back. In other words, I have the following object: Stylized...
asked by 27.04.2017 / 02:54
4
answers

Compare elements of an arrangement

How can I compare a variable with each and every element of an array var saludo = ["hi", "hola", "buenos dias", "buen dia"]; if(otraVariableX == saludo[]) { alert("Hola!!!"); } only the if works for me if I specify the position...
asked by 02.05.2017 / 21:51
3
answers

Events "keypress" "keydown" "keyup"

I want a certain function to be executed when I press a key, whatever. But let it run once (at the moment you press it). I expected to do this with "keydown" but behaves the same "keypress" addEvent(document, "keypress", function (e) {...
asked by 30.06.2017 / 22:40
3
answers

Cycle problem for JavaScript

I have the following code: leaderboard.length is defined from the server and in my case it is 12 var l = leaderboard.length; var i = 0; for ( ; i < l; i++) { var o = (i + 1) + ". " + name; } This will show me the positi...
asked by 19.04.2017 / 16:27
3
answers

Variable functions in javascript

In PHP we have the variable functions , which basically allow us to do this among other things class Bar { function __construct($foo) { $this->{'funcion' . $foo}(); } private function funcionHola() { e...
asked by 03.02.2018 / 04:50
1
answer

What is the difference between cookies and sessionStorage / localStorage?

I understand the difference between localStorage and sessionStorage, but what is the difference between cookies vs local / session? Which has more security, advantages, etc.? Which one is better to use? Greetings and thanks.     
asked by 21.09.2018 / 19:23
2
answers

What is the difference between making a script and calling one?

In a few words I want to know what the difference is, PROS and / or CONTRAS to have a script full of funciones , or to call a file .js that contains all the functions. So far I have not had problems creating files ....
asked by 20.09.2017 / 17:23
2
answers

Loop with timer and conditions (Javascript)

I just started in the world of Javascript and I have doubts ... I have the following function, I want it to repeat as long as the random value is 204. When the code is 200 it must stop, if it is 500 notify error and stop too. The request will...
asked by 23.08.2017 / 13:34
1
answer

Using window.print in Google Chrome does not print text

I am trying to generate the printing functionality of certain "text only" information using the "window.print" function. In both Microsoft Edge and Internet Explorer (IE9 and higher versions) the printing of a selected text works. Howeve...
asked by 09.08.2017 / 16:42