能不能控制JavaScript中的confirm对话框默认为"取消"按钮啊?

解决方案 »

  1.   

    我的模拟的::
    <%@ Page language="c#" Codebehind="subindex.aspx.cs" AutoEventWireup="false" Inherits="WebUI.subindex" %>
    <HTML>
    <HEAD>
    <title></title>
    </HEAD>
    <body onload="javascript:OpenLoginWindow()">
    <form id="Form1" method="post" runat="server" action="frist.aspx" target="_blank">


    <input type="hidden" name="postflag" id="postflag" value="notpost"> <input type="hidden" name="LogoUser" id="LogoUser">
    <input type="hidden" name="LogoPass" id="LogoPass"> <input type="hidden" name="SavePass" id="SavePass">

    </form>
    <script language="javascript">
    function OpenLoginWindow()
    {
     windowWidth = screen.width;
     windowHeight = screen.height;
     x = window.showModalDialog("logo.htm",'',"dialogWidth:320px;dialogHeight:300px;dialogTop: "+( windowHeight-300)/2+"; dialogLeft: "+( windowWidth-320)/2+";center:no;status:no ");
     if(x==null)
     {
       window.close();
     }
     else
     {
         document.Form1.postflag.value = "yespost";
         document.Form1.LogoUser.value = x.loginname;
         document.Form1.LogoPass.value = x.password;
         document.Form1.SavePass.value = x.savepass;
         document.Form1.submit();
         window.close();    
     }
    }
    </script>
    </body>
    </HTML>
    //logo.htm为你的文件!!!