$.request = function (name) {
var search = location.search.slice(1);
var arr = search.split("&");
for (var i = 0; i < arr.length; i++) {
var ar = arr[i].split("=");
if (ar[0] == name) {
if (unescape(ar[1]) == 'undefined') {
return "";
} else {
return unescape(ar[1]);
}
}
}
return "";
}
用法 var k= $.request(key)
jquery 获取url参数
最新推荐文章于 2018-10-26 11:04:32 发布