<script> window.open("toquery.htm?age=18"); </script>toquery.htm: ------------ <script> function toquery() { var tmpstr=unescape(window.location.toString()); var tmp=tmpstr.indexOf('?') tmpstr=tmpstr.substring(tmp+1,tmpstr.length); var strs=tmpstr.split('&'); for (var i=0;i<strs.length;i++) eval(strs[i]+";"); } toquery(); alert(age); </script> 总之就是通过window.location来传递,至于怎样处理这个字符串,就看你怎样的了,我上边的处理过于纰漏。
t=123
window.open("a.asp?t="+t)2.object
<script1>
win=window.open("about:<input type=button onclick=alert(window.t)>")
win.t=123
</script>3.opener
<script>
t=123
win=window.open("about:<input type=button onclick=alert(opener.t)>")
</script>
<script>
window.open("toquery.htm?age=18");
</script>toquery.htm:
------------
<script>
function toquery()
{
var tmpstr=unescape(window.location.toString());
var tmp=tmpstr.indexOf('?')
tmpstr=tmpstr.substring(tmp+1,tmpstr.length);
var strs=tmpstr.split('&');
for (var i=0;i<strs.length;i++) eval(strs[i]+";");
}
toquery();
alert(age);
</script>
总之就是通过window.location来传递,至于怎样处理这个字符串,就看你怎样的了,我上边的处理过于纰漏。