setTimeOut啊,没事干自己刷,管他开不开子呢。

解决方案 »

  1.   

    save as test.htm and test:
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    </head><body onunload="if (opener) opener.location.reload()">
    <a href="test.htm" target="_blank">dxxxx</a>
    <script>alert('hello,i\'m reloaded')</script>
    </body>
    </html>
      

  2.   

    原来LZ要求不能由子窗口控制,没看清题意,算我没说.呵呵那就每打开一个子窗口记下该窗口的变量,然后不停地用setInterval来测试该变量是否存在。
    以下省略代码n行。结尾再加一个注释:脱裤子打P
      

  3.   

    在窗口中判断打开的子窗口关闭没有,若关闭,则调用document.execCommand方法进行页面刷新.
    刚写的,只写了逻辑部分代码.
    代码如下:var windowList=[];
    function createWindow(){
    var newWindow=window.open("http://ham.javaeye.com","_blank");
            //将打开的窗口引用存入windowList数组中.
    windowList.push(newWindow);
    setInterval("checkClose()",1000);
    }
    function checkClose(){
    for(var i=0;i<windowList.length;i++){
    if(windowList[i].closed){
    alert("刷新页面");
    document.execCommand('Refresh');
    ...
    //将打开的窗口对象从windowList中移除.
    ...
    return;
    }
    }
    }
      

  4.   

    我是这么做的
    父.asp 
      包含一个如下javascript语句即可
       <script language="javascript">
     function submit11() {
          self.location.replace("<%=Request.ServerVariables("script_name")%>");
      }     
    </script>子.asp
       结尾用如下语句:
    <html>
    <body onLoad="load2()">
    <script language="javascript">
      function load2() {
          opener.setTimeout("submit11()",150)
          self.setTimeout("exit()",150)
      }
      function exit() {      window.opener=null;
          window.open('','_self');
          window.close();
      }
    </script>    
    </body>
    </html>就OK了!
      

  5.   

    在子窗口的onUnload时间中调用如下代码:
    openner.document.location.reload();
      

  6.   

    onUnload时间中调用如下代码: 
    opener.setTimeout("refreshfunction()",1);
    refreshfunction()函数为父窗口刷新
      

  7.   

      <script language="javascript"> 
      var pages=new Array();
      var i=0
    function Inc(){ 
             pages[i]=  window.open("h2.html",'公司',"height=480,width=600,scrollbars=yes") 
    pages[i].document.body.onunload=function(){
    location.reload();
    }
    i++;

    //只能关闭第一个窗口时主页面刷新,因为主页面刷新后有关子窗口的信息丢失了。
    //所有onunload必须写在子窗口里面

      </script> 
    <input type="button" value="选择数据"  id="Button4" onclick="return Inc();">