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