Tongates(文文) :请问如何实现模式窗口阿?谢谢

解决方案 »

  1.   

    方法1
    function doModal(url){
    win=window.showModalDialog(url,0,"dialogWidth:500px;dialogHeight:500px;status:no;help:no;");
    document.location.reload();
    }showModalDialog()将中断主窗口的运行直到自己被关闭。
    所以document.location.reload();在showModalDialog关闭后才执行方法2
    在父窗口
    function doModal(url){
    win=window.showModalDialog(url,0,"dialogWidth:500
    px;dialogHeight:500px;status:no;help:no;");
    if (win=="t")
     {
     document.location.reload(ture); 
     }
    }
    在模式窗口 
    window.onunload()
    {
    window.returnValue=="T";
    }方法3
    用window.opener.location.reload()就可以了。
    use window.open to open the window
    and <body onbeforeunload="opener.location.reload()"><INPUT type=button value="刷新" onclick="opener.location.reload()">
    <a href="javascript:opener.location.reload();">刷新父窗口</a>
    <a href="javascript:parent.location.refesh();">刷新父窗口</a>自动关闭窗口的办法:<script language=javascript>
    alert("你的操作已成功");
    window.opener=null;
    window.close();
    </script><script>
    alert("您的操作已成功");
    window.close();
    </script><script language=javascript>
    alert("你的操作已成功");
    window.close;
    </script>