§ Handling url get string with javascript
Using javascript to handle url get string variables
This will find the value of a get variable and return it. If it is not found it returns false.
function getGetValue(getName) {
var getString = window.location.search.substring(1);
var getArray = getString.split("&");
var getNameValue;
for(var i=0;i<getArray.length;i++) {
getNameValue = getArray[i].split("=");
if(getNameValue[0]==getName)
return getNameValue[1];
}
return false;
}
last edited on February 14th, 2009 at 12:21 AM
Categories
Comments
- Slashback on "window.onload via double delegate function" - The makeDoubleDelegate() function is rather simple and straightforward, so I find it quite odd that Chrome can't handle it. I do…
- Joaquin Serra on "window.onload via double delegate function" - Hello, i'm using this function one year but i realized now that in Google chrome doesn't work. Have you got some solution?
- tadd on "Javascript function to add css" - thanks for the post
- Slashback on "window.onload via double delegate function" - The makeDoubleDelegate function just needs to be available, so include it once somewhere in your html file or an included javascript…
- Neil Haskins on "window.onload via double delegate function" - I don't understand exactly how this is to be used; I've just used javascript in a cut and paste manner really. Does the whole code go…