现有主界面form1.aspx在form1.aspx打开一个模态窗口show1.aspx在show1.aspx再打开另一个模态窗口show2.aspx如何将show2.aspx的传给show1.aspx并更新show1.aspx页面现在值已传过去,但是页面刷新一直是打开一个新页面。有什么办法解决?我现在的方法是判断值是否为空,然后window.location跳转页面,一直跳出新窗口。<base target="_self" /> 我也加了。

解决方案 »

  1.   

    1 父窗口:
    <script type="text/javascript">
    function openBrWindowInCentre(theURL,width,height) {
          var left, top;
          left = (window.screen.availWidth - width) / 2;
          top = (window.screen.availHeight - height) / 2;
          var per = 'width=' + width + ',height=' + height + ',left=' + left + ',top=' + top + ',screenX=' + left + ',screenY=' + top;
          window.open(theURL,'',per);
        }
    </script>
    <a href="javascript:void(0)" onclick="openBrWindowInCentre('child.html','600','400');">打开子窗口</a> 2. 子窗口 
    < script language="JavaScript" type="text/javascript"> 
    < !-- 
    function refreshParent() { 
    window.opener.location.href = window.opener.location.href; 
    if (window.opener.progressWindow) 

    window.opener.progressWindow.close(); 

    window.close(); 
    } //--> 
    < /script> < a href="javascript:void(0)" onclick="refreshParent()">刷新父窗口并关闭当前窗口</a>
      

  2.   

    加载Ajax,里面有模态对话框控件!
      

  3.   

    哎,找了下网上资料,自己研究下window.name = "__self";
    window.open(url, "__self")
    完美解决多层模态传参和更新当层模态。