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;
}
//测试
function test(){
// alert(GetQueryString("url"));
var
myurl=GetQueryString(
"url"
);
if
(myurl !=
null
&& myurl.toString().length>1)
{
alert(GetQueryString(
));
}
|
}
原文链接:https://www.f2er.com/regex/359944.html