Questions tagged as 'javascript'

3
answers

Call a javascript function from another page

How can I call a javascript function from another page? Example: Page5.html <a href="javascript:irAFuncionDePagina2Html();">Contacto</a> I add more explanation, I thought it would be better understood with the previous exa...
asked by 17.12.2018 / 16:27
1
answer

Separate 1 variable in 2 when you find a JS Script [duplicated]

Cordial Greeting. I tell you what I want to do. Example, I have a variable like this: var id = "673728-882"; What I want to do, is that I separate that into 2 variables where the script is, example of how it should be: var id2 =...
asked by 22.11.2018 / 15:54
4
answers

How to make a javascript switch

I have several if-else that I need to simplify: var color = ""; if (tipo == "0") { color = "FF0000"; } else if (tipo == "1") { color = "CC9900"; } else if (tipo == "2") { color = "AA0000"; .... } else { color = "000000"...
asked by 28.07.2016 / 19:09
1
answer

How to call a unique json value, example name (the json has id, first name, last name, etc.) [closed]

fs.readFile("user.json", function (err, data) { if (err) throw err; console.log(data.toString()); });     
asked by 22.11.2018 / 00:57
1
answer

How to check if a div has no content

I wanted to know how I can check if a div is empty by javascript without using jquery only with pure javascript. Because I have searched and only with jquery I can find it and I need it only with pure javascript.     
asked by 17.07.2018 / 18:02
1
answer

Problem loading data with JQuery in a table

Good morning everyone. I have the problem when loading some rows in a table, I have to click several times on the link that shows this table so that the rows appear. $("#btnlogin").click(function (){ var user = $("#user").val(); var pass =...
asked by 05.09.2017 / 22:13
1
answer

How to set the width value?

How can I set a value of a variable, as if it were an equation? In this case I will have: var a = document.body.scrollWidth; var b = 500; var x = null; What I need to do is find a number such that a - x = b , regardless of th...
asked by 12.09.2017 / 01:23
1
answer

JQuery replace text dynamically [closed]

I am trying to create a gallery where the texts change when the user clicks on the pink bar that now shows the text: "Previus Text" / "Post Text", respectively. Here the code: link What I do not get in any way is that all the texts that...
asked by 02.09.2017 / 21:30
1
answer

Mark map according to a search [closed]

I have a json file with an array of various city points and I want to place the points on a map using a simple search engine. With a text input that serves as a search engine so that when looking for the attribute "name" of the node "destinat...
asked by 24.05.2016 / 20:39
1
answer

Obtain the necessary data from a URL to display the web content [duplicated]

For the use of a forum, I would like to know how it could, introducing only the URL of a gif for example ( link ), obtain the necessary data so that the gif is displayed and not have to be imbibed manually. Is information parsed with JavaSc...
asked by 08.07.2017 / 05:28