a.html
Documenttitle>输入:
body>
$(":button").click(function(){
var val=$("#in").val();
window.open("b.html?id="+val) //location.href="b.html?id="+val
// var str="as=df"
// alert(str.indexOf("="))
// str=str.substr(2)
// alert(str)
})script>html>
b.html
Documenttitle>head>bbbbbbbbody>
var href1=location.search;
alert(href1) var len=href1.indexOf("=")+1
alert(len) script>html>
结果:?id=22
总结:主要是location.search这个函数,得到参数部分,然后可以用字符串截取的方法得到参数。