function GetRequest() {
var url = location.search;
var theRequest = new Object();
if (url.indexOf("?") != -1) {
var str = url.substr(1);
strs = str.split("&");
for (var i = 0; i < strs.length; i++) {
theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
}
}
return theRequest;
}
var id = GetRequest().articleid;
console.log( id );
function getParam(url, name) {
try {
var reg = new RegExp("(^|&)" + name + “=([^&]*)(&|$)”);
var r = url.split(’?’)[1].match(reg);
if(r != null) {
return r[2];
}
return “”;//如果此处只写return;则返回的是undefined
} catch(e) {
return “”;//如果此处只写return;则返回的是undefined
}
};