I can pass the variable to next page. Depending on the choice chosen, i have a function which will execute the URL. Does anyone have a code in javascript function call another function. Please Help....!
I can pass the variable to next page. Depending on the choice chosen, i have a function which will execute the URL. Does anyone have a code in javascript function call another function. Please Help....!
Here is the code in java for you for the same you wanted :
Code:function QueryString(key) { var value = null; for (var i=0;i<QueryString.keys.length;i++) { if (QueryString.keys[i]==key) { value = QueryString.values[i]; break; } } return value; } QueryString.keys = new Array(); QueryString.values = new Array(); function QueryString_Parse() { var query = window.location.search.substring(1); var pairs = query.split("&"); for (var i=0;i<pairs.length;i++) { var pos = pairs[i].indexOf('='); if (pos >= 0) { var argname = pairs[i].substring(0,pos); var value = pairs[i].substring(pos+1); QueryString.keys[QueryString.keys.length] = argname; QueryString.values[QueryString.values.length] = value; } } } QueryString_Parse();
Normally, you take these variables with a language as PHP or JSP and d 'to act on them. Him and the moments that if you have n 'does not have access to a part of the language or simply need to treat these parameters via JavaScript. Here how.
Code:var searchString = document.location.search; // strip off the leading '?' searchString = searchString.substring(1); var nvPairs = searchString.split("&"); for (i = 0; i < nvPairs.length; i++) { var nvPair = nvPairs[i].split("="); var name = nvPair[0]; var value = nvPair[1]; }
You want to get the value from the frank parameter so you call the javascript function as follows :
var frank_param = gup( 'frank' );
Bookmarks