There isn't an object to do it directly AFIK, you need to use a custom function... here's one I use:
Code:
function cbegeturlArguments() {
var params = new Array();
if (location.search) {
var pairs = location.search.substring(1, location.search.length).split("&");
for (var i=0; i<pairs.length; i++) {
nameVal = pairs[i].split("=");
params[i] = nameVal[1];
params[nameVal[0]] = nameVal[1];
}
}
return params;
}
Then you call the "GET" variables into an array:
var urlArgs = cbegeturlArguments();
and then you can call them by name from that array:
www.yoursite.com/page.html?color=blue
alert(urlArgs["color"]);
will alert "blue" - you dig? Also, Java and Javascript are 2 different things... was this what you were looking for?
Last edited by funkdaddu; 12-05-2005 at 11:17 PM..
|