PHP
·
发表于 5年以前
·
阅读量:8312
function getQueryString() {
var result = {}, queryString = location.search.substring(1),
re = /([^&=]+)=([^&]*)/g, m;
while (m = re.exec(queryString)) {
result[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);
}
return result;
}
用法示例:
var myParam = getQueryString()["myParam"];