JS获取地址栏参数

获取地址栏参数(其中name为你所需要的参数值)
function GetQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}

posted @ 2014-10-08 19:03  the boy、图样图森破  阅读(146)  评论(0编辑  收藏  举报