今天刚看到一个例子里面有用到 window.location.search.substring 这个方法,以前没用过,查了一下,记录下来:
location.search是从当前URL的?号开始的字符串 如:http://topic.csdn.net/search.aspx?u=dd 它的u就是?u=dd 要获取完整的地址 var url = window.location.search.substring(1,location.search.length);