Questions tagged as 'javascript'

4
answers

How to know which key was pressed

I need that every time a key is pressed, a function will be executed, which will vary depending on the key that was pressed. So I need to know what key was pressed. This is what I have so far: function onKeyDownHandler() { conso...
asked by 30.06.2017 / 16:30
6
answers

Can more than one id be placed in a single input type text?

my question is if you can place more than one id in an input because I have a function in javacript that I send it to call in the id of an input type text but in that input I also have to have the id with the variable in my database. where the...
asked by 22.02.2017 / 20:56
2
answers

context this in function arrow with prototype

In the following example I have a class and add two functions by prototype the first as defined by funcion normalmente , while the second with arrow function simpleClase = function(){ this.ejemplo = 1 } simpleClas...
asked by 02.02.2018 / 02:51
4
answers

Understanding the indexOf

Why when using the indexOf method should the condition to find the words beginning with "A" be equal to 0? let teachers =["Alexys", "Jon", "Daniel", "Francisco", "Rafa",...
asked by 12.02.2018 / 21:34
2
answers

Send a string as a file using request in Node

I have a String and I want to convert it to a stream to send it as if it were a file via multipart of request . I want to do it in the air, without generating the file on disk. I'm doing it this way: const stream = requi...
asked by 15.03.2017 / 17:54
2
answers

Validate DatePicker Jquery

I am validating my form with formvalidation , the date is only Valid if I write it, if I choose it from the calendar, it is not valid. If you can help me validate it, I would appreciate your help. I use the datepicker from Jquery. Form fie...
asked by 06.06.2016 / 22:05
3
answers

Differences between x ++ and ++ x in JavaScript [duplicated]

What are the differences between these two expressions? x++ and ++x This is the code I was trying to understand: var x=1, y=1, z=0; do{ z=x+y; console.log("z= "+ z);} while(++x<=1 && y++>...
asked by 05.09.2017 / 11:44
2
answers

How to rotate 180 degrees horizontally a div

I have a simple example of a div, which I want to rotate 180 degrees horizontally, my example rotates vertically which I do not want <!DOCTYPE html> <html> <head> <style> div { width: 200px; height: 10...
asked by 23.12.2016 / 23:33
1
answer

Safe way to escape user input to be processed by regular expressions in JavaScript

The following example is published in link : function escapeRegExp(string) { return string.replace(/[.*+?^${}()|[\]\]/g, '\$&'); } Is this the safe way to escape a string provided by the end user, for example through a dialog box?...
asked by 13.02.2017 / 15:48
2
answers

How to check the father, when I select the child in a checkbox with jQuery

How could I do a checked event in jQuery? I have this structure: With the serious code: <ul> <li class="padre_menu"> <div class="checkbox"> <label> <input name="padre[...
asked by 07.09.2016 / 17:02