var $_GET = (function(){
var url = location.search.toString();
var u = url.split("?", 2);
if(typeof(u[1]) === "string"){
u = u[1].split("&");
var get = {};
for(var i in u) {
var j = u[i].split("=");
get[j[0]] = j[1];
}
return get;
}
else
return {};
})();
用法
例如现在URL为:
xxx.github.io/xxx.htm?UID=88888
然后可以
var UID = $_GET["UID"];