网页关闭时 如何在对话框上增加链接,或者能否自定义对话框?

解决方案 »

  1.   

    什么意思?  用confirm()不行吗?
      

  2.   

    一个简单的弹出层例子
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
     <HEAD>
      <TITLE> New Document </TITLE>
      <META NAME="Generator" CONTENT="EditPlus">
      <META NAME="Author" CONTENT="">
      <META NAME="Keywords" CONTENT="">
      <META NAME="Description" CONTENT="">
     </HEAD>
     <script type="text/javascript">
    function locking() {
                document.all.ly.style.display = "block";
                document.all.ly.style.width = document.body.clientWidth;
                document.all.ly.style.height = document.body.clientHeight;
                document.all.Layer2.style.display = 'block';
            }
            function Lock_CheckForm() {
                document.all.ly.style.display = 'none';
                document.all.Layer2.style.display = 'none';
            }
    </script>
     <BODY> <input ID="Button1"  type="button" value="弹出层"  onclick="locking()"/>
      <div id="ly" style="position: absolute; top: 0px; filter: alpha(opacity=60); background-color: #FFFFFF;z-index: 2; left: 0px; display: none;"></div>
     <div id="Layer2" align="center" style="position: absolute; z-index: 3; left: expression((document.body.offsetWidth-240)/2); top: expression((document.body.offsetHeight-170)/2);display:none" >
     <table width="500" border="1" cellpadding="0" cellspacing="0" bordercolor="#2B8ACD"  >
                <tr>
                    <td style="background-color: #C6DAEF; padding-left: 4px; padding-top: 2px;
                        font-weight: bold; font-size: 14px;" height="27" valign="middle" width="20%">
                        名称:</td>
                </tr>
                <tr>
                    <td style="background-color: #C6DAEF; padding-left: 4px; padding-top: 2px;
                        font-weight: bold; font-size: 14px;" height="27" valign="middle" width="20%">
                        链接:</td>
                </tr>
                <tr>
                    <td  align="center" style="background-color:#e7e3e7" colspan="2">
                        
                      <input type="button" value="保 存" id="save"  />
                      <input type="button" value="取 消" id="cancel"  onclick="Lock_CheckForm();" />
                      <input type="hidden" id="hdTd" />
                    </td>
                </tr>
    </table>
    </div>
     </BODY>
    </HTML>
      

  3.   

    谢谢了,弹出层可以做,主要是在关闭网页的时候如何先弹出该层,用户通过层再将网页关闭了,就是类似 showModalDialog 那样
      

  4.   

    <html>
    <head>
    <title>test</title></head>
    <body>
    </body>
    <script type="text/javascript">
     window.onunload= function(){
       var aa=confirm("are you go to 'baidu'");
       if(aa)
       window.open("http://www.baidu.com","")
     }
    </script>
    </html>这样可以不?