有关用js在两个页面传参数的问题~~~
从a.html跳转到b.html页面,同时传一个参数过去。我现在已经实现这些功能,但是这个b.html是新打开的,我想让b.html页面代替a.html,请问该如何实现?具体请看代码和注释:
a.html:
function openPage2(value){ //在a.html页面里调用这个函数,新打开b.html,同时把value传过去.org/TR/xhtml1/DTD/xh
Ext.onReady(function(){ //打开b.html后,会自动加载这个函数
var data = window.opener.passToPage2.staffId;//获得传过来的值,这个功能已经实现
}
window.open('http://127.0.0.1:8080/pm/html/b.htmlnhttp://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>test</title><style type="text/css">*{ padding:0; margin:0; font-size:18px; font-family:Arial, Helvetica, sans-serif;}body{background-color:#fff; }div {border:1px solid red; display:none}</style><script type="text/javascript">window.onload=function(){ var arrID=new Array('a','b','c','d') var arr=top.arr, t=0,id=0; for(var i=0;i<arr.length;i++){ id=arr[i]>t?i:id; t=arr[i]>t?arr[i]:t; } document.getElementById(arrID[id]).style.display="block";}</script></head><body><div id=a>aaaaaaaaaaaaaaaa</div><div id=b>bbbbbbbbbbbbbbbb</div><div id=c>cccccccccccccccc</div><div id=d>dddddddddddddddd</div></body></html>