§ 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
- Walid on "Adventures with Ubuntu 9.10 on G4 Yikes!" - I am in the same process as you. Although I still dual-boot to Windows for my ganimg leisure. My first contact with Ubuntu was way…
- Slashback on "Simpler adding & removing element classnames" - Actually, the addClassName function does what you want, pretty much the same way you suggest.
- angie on "Simpler adding & removing element classnames" - And what if I want to add a class, but keeping the csseals the element already has?I mean, I have an element with a class, let's name…
- 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!