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;
}
例: baidu.com?id=123&name=baidu
alert(GetQueryString("id"));
此时就能弹出123了