function getQueryStringRegExp(name) {
//var reg = new RegExp("(^|\\?|&)" + name + "=([^&]*)(\\s|&|$)", "i");
var reg = new RegExp("(^|[?|&])" + name + "=([^&]*)(\\s|&|$)", "i");
// (|^[?|&])id=([^&]*)(\\s|&|$)
if (reg.test(location.href)) return RegExp.$2; //decodeURI(RegExp.$2.replace(/\+/g, " "));
return "";
}
获取参数值的时候 getQueryStringRegExp('参数');
http://www.google.com/id=11