I would like to create a pause inside a while loop so that I can create n animations that each appear 3 seconds after the other. I’ve tried the following, but it doesn’t work. Would love to have someone show me what I’m doing wrong. Answer setTimeout does not pause; it asks Javascript to run…
Tag: javascript
How to get character array from a string?
How do you convert a string to a character array in JavaScript? I’m thinking getting a string like “Hello world!” to the array [‘H’,’e’,’l’,’l’,’o’,’ ‘,’w’,’o’,’r’,’l’,R…
Download a file by jQuery.Ajax
I have a Struts2 action in the server side for file downloading. However when I call the action using the jQuery: in Firebug I see the data is retrieved with the Binary stream. I wonder how to open the file downloading window with which the user can save the file locally? Answer 2019 modern browsers update Th…
Close all infowindows in Google Maps API v3 [duplicate]
This question already has answers here: Google Maps close previous Infowindow when another marker is clicked (1 answer) Google map API v3 – Add multiple infowindows (2 answers) Google Maps JS API v3 – Simple Multiple Marker Example (15 answers) Closed last month. I am busy with a script that will …
What is console.log?
What is the use of console.log? Please explain how to use it in JavaScript, with a code example. Answer It’s not a jQuery feature but a feature for debugging purposes. You can for instance log something to the console when something happens. For instance: You’d then see #someButton was clicked in …
Javascript Equivalent to PHP Explode()
I have this string: 0000000020C90037:TEMP:data I need this string: TEMP:data. With PHP I would do this: How do I effectively explode a string in JavaScript the way it works in PHP? Answer This is a direct conversion from your PHP code:
Converting a native js event object to jQuery event object
I want to convert a native JavaScript event object to jQuery event object. Actually this is the problem: I have bound an event handler to documents keyup event via jQuery and there are some text boxes on the page with which a keyup event handler is bound via inline JavaScript. The problem is when the text box…
Search a table looking for labels
I am trying to search a table looking for all the labels in that table. When the JavaScript function finds a label I want to set it’s visibility to false. My html code looks like this: My function is called on a drop down lists onchange event which then passes the table that holds all the labels I want …
JavaScript % (modulo) gives a negative result for negative numbers
According to Google Calculator (-13) % 64 is 51. According to Javascript (see this JSBin) it is -13. How do I fix this? Answer Taken from this article: The JavaScript Modulo Bug
javascript regular expression to check for IP addresses
I have several ip addresses like: 115.42.150.37 115.42.150.38 115.42.150.50 What type of regular expression should I write if I want to search for the all the 3 ip addresses? Eg, if I do 115.42.150.* (I will be able to search for all 3 ip addresses) What I can do now is something like: /[0-9]{1-3}.[0-9]{1-3}.…