Page is a not externally linkable
dhdweb - 12:06 am on Oct 29, 2002 (gmt 0)
Using the following script: If the query is "?a=01" thru "?a=07" the output is 1 thru 7 Please help! dhdweb
Better yet, can anyone solve this problem?
function getArgs() {
var args = new Object();
var query = location.search.substring(1);
var pairs = query.split("&");
for(var i = 0; i < pairs.length; i++) {
var pos = pairs[i].indexOf('=');
if (pos == -1) continue;
var argname = pairs[i].substring(0,pos);
var value = pairs[i].substring(pos+1);
args[argname] = unescape(value);
}
return args;
}
var args = getArgs();
if (args.a) a = parseInt(args.a);
document.write(a);
But, (this is the killer!)
If the query is "?a=08" or "?a=09" the output is 0