请教各位高手关闭弹出窗口时刷新父窗口的问题
我通过windows对象的open()方法打开一个新窗口(子窗口),当我在子窗口中进行数据库操作(例如:数据添加、修改或删除等)后,关闭子窗口时,系统会自动刷新父窗口来实现实时更新信息。当我用windows对象的close()方法关闭子窗口时就是关闭不了,同时父窗口也没有更新,请问各位高手,有没有相关示例提供给我看看,万分感谢。
------解决方案--------------------不知道你的父页面有没有转页,下面有个例子 
 //a.html 
  <html>  
  <head>  
  <meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">  
  <title> 新建网页 1 </title>  
  <script>  
 function open_win(){ 
 div1.innerHTML= "已经操作了 ";//父页面没有转页 
 window.open( "b.html ", " ", "width:300px;height:200px "); 
 //document.write( "已经操作了 ");//父页面已经转页,即浏览器上方的 "后退 "按钮有效 
 } 
  </script>  
  </head>  
  <body>  
  <div id=div1> 刚加载 </div>  
  <input type=button onclick=open_win() value= "打开窗口 ">  
  </body>  
  </html>    
 //b.html 
  <html>  
  <head>  
  <meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">  
  <title> b </title>  
  <script>  
 function return_back(){ 
 opener.history.go();//没有转页 
 //opener.location.reload();//没有转页 
 //opener.history.back();//已经转页 
 //opener.history.go(-1);//已经转页 
 window.close(); 
 } 
  </script>  
  </head>  
  <body>  
  <input type=button value= "关闭 " onclick=return_back()>  
  </body>  
  </html>
------解决方案--------------------用这种方法 就是不用在页面单独做按钮,直接点击右上的关闭按钮 然后刷新 
 function window.onbeforeunload() 
 { 
 	if(event.clientX> 360&&event.clientY <0||event.altKey) 
 	{  		 
 		event.returnValue= "OK? "; 
 		opener.location.reload();  	  					 
 	} 
 }   
 LZ是想要这种效果么?
------解决方案--------------------a.htm: 
  <!DOCTYPE html PUBLIC  "-//W3C//DTD XHTML 1.0 Transitional//EN "  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">  
  <html xmlns= "http://www.w3.org/1999/xhtml " >  
  <head>  
      <title> 无标题页 </title>  
      <script>  
     function refresh(str) 
     { 
         document.getElementById( "txt ").value=str; 
     } 
      </script>  
  </head>  
  <body>  
      <input id= "txt " type= "text "  />  
      <input id= "Btn " type= "button " value= "打开子页面 " onclick= "window.open( 'b.htm ') " />    
  </body>  
  </html>    
 b.htm: 
  <!DOCTYPE html PUBLIC  "-//W3C//DTD XHTML 1.0 Transitional//EN "  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">  
  <html xmlns= "http://www.w3.org/1999/xhtml " >  
  <head>  
      <title> 无标题页 </title>  
      <script>  
     function passValue() 
     { 
         var pass=document.getElementById( "txt2 ").value; 
         window.opener.refresh(pass); 
         window.focus(); 
         window.opener=null; 
         window.close(); 
     } 
      </script>  
  </head>  
  <body>  
  <input type= "text " id= "txt2 " value= "这是我传给你的,你要收好了 " />  
  <input type= "button " value= "传值并刷新 " onclick= "passValue() " />  
  </body>  
  </html>    
 这个就是你要的效果