现在的位置: 首页 > 综合 > 正文

window.location.search的用法

2012年09月13日 ⁄ 综合 ⁄ 共 171字 ⁄ 字号 评论关闭
location.search是从当前URL的?号开始的字符串
如:http://www.51js.com/viewthread.php?tid=22720
它的search就是?tid=22720

要获取完整的地址
var url = window.location.search.substring(1,location.search.length);

抱歉!评论已关闭.