"UserId/
re = new RegExp("UserId=(.*?)&","i"); // 创建正则表达式对象。
r = location.search.match(re);
if(r == null)
alert("没有UserId");
else if (r[1] == "")
{
alert("UserId为空")
}
re = new RegExp("UserId=(.*?)&","i"); // 创建正则表达式对象。
r = location.search.match(re);
if(r == null)
alert("没有UserId");
else if (r[1] == "")
{
alert("UserId为空")
}
r = location.search.match(re);
if(r == null)
{alert("没有UserId");}
else if (r[1] == "")
{
alert("UserId为空");
}
这样就行