自己用 showModalDialog() 模拟去

解决方案 »

  1.   

    用showModalDialog()自己做一个啊!
      

  2.   

    //a.htm
    <script language="JavaScript">
    <!--
    function Alert(strText){
    var pWin=window.showModalDialog("b.htm",strText,"dialogHeight:116px; dialogWidth:232px; help: No; resizable: no; status: No; scroll:no; dialogTop:"+(screen.height-116)/2+"px; dialogLeft:"+(screen.width-232)/2+"px;");
    }
    Alert("用户名非法!");
    //-->
    </script>// b.htm
    <html>
    <head>
    <style type="text/css">
    body{ }
    td,input{ font-size:12px}
    </style>
    <script language="JavaScript">
    <!--
    var str  =  window.dialogArguments;
    function doSure(){
    if(txtPwd.value==""){
    alert("密码不能为空!");
    txtPwd.focus();
    return;
    }
    window.returnValue=txtPwd.value;
    window.close();
    }function doOk(){
    window.returnValue="";
    window.close();}
    //-->
    </script>
    <body style="background-color:buttonface; margin:0" >
    <table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
    <tr height="65%">
    <td width="25%" align="center" valign="center"><img src="warning.gif" style="width:32px; height:32px"></td>
    <td valign="middle">
    <script language="JavaScript">
    <!--
    document.write(str);
    //-->
    </script>
    </td>
    </tr>
    <tr height="35%">
    <td colspan="2" align="center" valign="top">
    <input type="button" id="btnOk" value="  确定  " onclick="doOk()">
    </td>
    </tr>
    </table>
    </body>
    <script language="JavaScript">
    <!--
    document.onclick=function (){
    document.getElementById("btnOk").focus();
    }
    document.body.oncontextmenu=function (){
    document.getElementById("btnOk").focus();
    }
    //-->
    </script>
    <html>// warning.gif :C:\WINDOWS\PCHealth\HelpCtr\System\images