This version avoids using the eval() function and so is neater and safer.
[Compared with the version given in an earlier note in this blog]
var GLOBAL={}
location.search.replace(
new RegExp("([^?=&]+)(=([^&]*))?", "g"),
function($0, $1, $2, $3) {
GLOBAL[$1]=$3;
}
);
No comments:
Post a Comment