Skip to content
Advertisement

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 This is the approach

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 make a google maps canvas on my website, with

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 Firebug’s “Console” tab (or another tool’s console — e.g.

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:

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 to

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}.[0-9]{1-3}.[0-9]{1-3}/ but it can’t seems to work

Check if JavaScript is enabled with PHP

Is there a way to check if JavaScript is enabled with PHP? If so, how? Answer No, that is not possible, because PHP is a server side language, it does not access the client’s browser in any way or form (the client requests from the PHP server). The client may provide some meta info through HTTP headers, but they don’t

Adding to browser context menu?

Is it possible to add item to the default browser right button click menu? Answer One option is to replace the context menu with your own JavaScript triggered equivalent. Firefox implemented the menu element where you can add to the existing context menu. It was also implemented in Chrome behind a flag. Unfortunately this feature has been removed from the

Advertisement