location.search是从当前URL的?号开始的字符串
如:http://www.51js.com/viewthread.php?tid=22720
它的search就是?tid=22720
如:http://www.51js.com/viewthread.php?tid=22720
它的search就是?tid=22720
要获取完整的地址
var url = window.location.search.substring(1,location.search.length);