hao_2468

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

今天刚看到一个例子里面有用到 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);

posted on 2010-01-05 15:14  hao_2468  阅读(384)  评论(0编辑  收藏  举报