JS获取URL中的参数串

假如URL为http://www.baidu.com/index.html?p1=fk&p2=sht

则通过JS代码获得?后面的参数串语句为:document.location.search 

得到结果为:?p1=fk&p2=sht(注意是带问号的

 

兼容所有浏览器。

posted @ 2010-12-02 11:59  michael_lee  阅读(172)  评论(0编辑  收藏  举报