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

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

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

 

兼容所有浏览器。

相关文章: