折腾了好久,终于搞出来了。参考资料

http://www.cnblogs.com/davidyang78/archive/2011/07/29/2121278.html

下面直接上源码,保证兼容ie,google,360,firefox

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <!--防止模态窗口提交form时再弹出一个新窗口-->
    <base target="_self" />
    <script type="text/javascript">
        function DialogWin(url, width, height) { height = height + 50; if (url.indexOf('.aspx?', 0) > 0) { url = url + '&t=' + Math.random(); } else { url = url + '?&t=' + Math.random(); } return window.showModalDialog(url, window, ";dialogWidth:" + width + "px;dialogHeight:" + height + "px;center:1;scroll:auto;help:0;status:0;statusbars:0;location:0;menubar:0;toolbars:0;resizable:0;"); }
        function openClick() {
            var result = DialogWin("HtmlPage1.html", 500, 300);
            if (typeof (result) == 'undefined') {
                result = window.ReturnValue;
            }
            if (result==true) {
                window.location = window.location;
            }
        }
    </script>

</head>
<body>
    <input type="button" id="btnSub" onclick="openClick()" value="弹出" />
</body>
</html>
父窗体

相关文章:

  • 2022-12-23
  • 2021-12-29
  • 2022-12-23
  • 2022-12-23
  • 2021-07-19
  • 2021-11-16
猜你喜欢
  • 2021-05-23
  • 2022-12-23
  • 2021-11-02
  • 2022-12-23
  • 2021-12-21
  • 2021-10-04
  • 2021-11-25
相关资源
相似解决方案