§ 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
- backlinks on "Adjust iframe height to contents" - Definitely helped me.
- Slashback on "Simpler validate form fields are filled in (no additional class names)" - You are welcome!
- humour on "Simpler validate form fields are filled in (no additional class names)" - thanks for the script !
- Slashback on "Simpler validate form fields are filled in (no additional class names)" - Thank you. I'm glad it helped!
- buy site on "Javascript function to add css" - Well, i have faced this problem a lot of times and now i got how to add CSS to my java script. I bookmarked your page and will come…