Questions tagged as 'javascript'

4
answers

because the Boolean value of undefined is false, but when compared to false it is different.

The case var resu; undefined? resu = "esto seria inesperado" : resu = "debería dar esto"; console.log(resu); But when I'm going to confirm the theory that undefined is false : var resu; undefined ==...
asked by 25.06.2018 / 18:59
3
answers

Separate string in jQuery

If I have a text string such that: var cadena1 = "cadena_1"; And I just need to get 1 from the previous string to put it in a variable, how can I do it? Doing this: var res = cadena1.split("_"); the result is cadena,1     
asked by 23.01.2017 / 11:47
3
answers

Difference between Bubbling and Capturing

What is the difference between event event bubbling and capturing? Which of the two is the most indicated to use? In which aspects is each of them more efficient? In which cases would we use each of them?     
asked by 28.09.2017 / 11:18
2
answers

Send data to the server using Ajax using JavaScript Promises

Since the Javascript Promises promise a lot. One of the things that I would like to know is how to make an Ajax request with promises , in pure Javascript, without having to go through third-party libraries. It would be a request that adequa...
asked by 14.07.2017 / 13:23
2
answers

Problems with javascript date

I have the following code: var max = new Date().getFullYear(), min = max - 90, select = document.getElementById('selectYear'); for (var i = min; i<=max; i++){ var opt = document.createElement('option'); opt.valu...
asked by 11.04.2017 / 03:09
1
answer

What is the difference between declaring a JSON object with: y =?

I've always had doubts about the difference between obj1 and obj2 var obj1 = { propiedad1: String, propiedad2: Boolean, propiedad3: Number, propiedad4: null, propiedad5: "Opcion1" || "Opcion2", propiedad6: { prop...
asked by 23.10.2017 / 16:31
5
answers

Access a constant inside an object in javascript

I am creating a custom event method, to do so I must create the event types as constants. My question is how to access a constant within an object. Example: var EventManager=function() { const EVENT_ON_USER_LOGIN = "EVENT_ON_USER_LOGIN"...
asked by 18.12.2016 / 19:53
3
answers

Decode HTML & # 209 entities & &

I'm using the JQuery autocomplete library. I currently have a function that decodes HTML entities of numeric type - > &#209; , but what I do not know is how to integrate entities of this type into the function - > &amp;...
asked by 24.11.2016 / 19:47
3
answers

Convert radians to degrees

I am doing a calculation to obtain a value in degrees, but I have found that the result of an operation in JavaScript , where the types of trigonometric operations intervene, throws these values in radians. Formula 23.45 * sin(360 * ((284...
asked by 03.05.2018 / 00:13
3
answers

Slack files: XMLHttpRequest can not load response for preflight is invalid (redirect)

I am using [email protected] to make a request to the api of slack . According to Slack files types I need to add the Authentication in the header. I make the request from postman and it returns the file I need. GET /...
asked by 14.03.2016 / 03:37