因为页面提交跳转,childWin句柄在新页中不再有效,建议你用隐藏帧的方式,提交后将原页面藏起来,使窗口句柄继续有效。参考
<frameset name=myfrmset cols="*,1005">
<frame name=hide src=target.htm>
<frame name=show src=submit.htm>
</frameset>target.htm//将这个换为你的php页
<input type=button onclick=top.show.childWin.close()>submit.htm
<script>
var childWin;
function myopen()
{
childWin=window.open('process.htm','','width=250,height=40,status=yes');
top.myfrmset.cols="100%,*";
}
</script>
<form action="target.htm" target=hide>
<input type="submit" value="提交" name="submit" onclick="myopen()">
<input type=button onclick=childWin.close()>
</form>

解决方案 »

  1.   

    因为页面提交跳转,childWin句柄在新页中不再有效,建议你用隐藏帧的方式,提交后将原页面藏起来,使窗口句柄继续有效。参考
    <frameset name=myfrmset cols="*,1005">
    <frame name=hide src=target.htm>
    <frame name=show src=submit.htm>
    </frameset>target.htm//将这个换为你的php页
    <input type=button onclick=top.show.childWin.close()>submit.htm
    <script>
    var childWin;
    function myopen()
    {
    childWin=window.open('process.htm','','width=250,height=40,status=yes');
    top.myfrmset.cols="100%,*";
    }
    </script>
    <form action="target.htm" target=hide>
    <input type="submit" value="提交" name="submit" onclick="myopen()">
    <input type=button onclick=childWin.close()>
    </form>
      

  2.   

    本来就是没有定义嘛,在前一个窗口定义的变量在后一个窗口怎么还能引用,变量空间变了嘛。
    有框架的话把新的窗口对象保存在框架里面吧:
    提交前:
    parent.newChildWin = childWin;
    提交后:
    childWin = parent.newChildWin;
      

  3.   

    方法很多种,就按照你的想法吧:)
    <input type="submit" value="提交" name="submit" onclick="var childWin=window.open('process.htm','submit','width=250,height=40')">
    </form> //注意打开新窗口的第二个参数在关闭打开的窗口childWin之前,肯定要先得到这个窗口的句柄才行:
    <SCRIPT LANGUAGE="JavaScript">
    <!--
      childWin=window.open('','submit'); //根据submit得到刚刚窗口的句柄
      childWin.close();
    //-->
    </SCRIPT>搞定了。
      

  4.   

    process还是不用打开个新窗口了吧,你设置个<DIV id=processID position:absolute;  z-index:1; overflow: auto;  visibility: hidden;"></DIV>
    定义个process函数
    当你提交的时候processID.style.visibility="visible"
    这样当页面提交时间比较长的时候就显示process,提交完成后页面跳转,当然也就没有了process显示过程,我在上传文件里使用这个方法,比较好用。