http://www.csdn.net/Develop/read_article.asp?id=25378

解决方案 »

  1.   

    alert()上的文字是系统自动的,你是没法改的,当然用英文的操作系统的时候自动就是OK和Cancel了。
      

  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="">
    <STYLE TYPE="text/css" TITLE="">
    body,center,input {
    font-family:Verdana;
    font-size:12px;
    }
    </STYLE>
    </HEAD><BODY>
    <script language="JavaScript">
    function window.alert(x) {
      showModalDialog(document.location.href+"?cnt="+x,"","dialogHeight:100px;dialogWidth:200px;status:no;");
    }
    if (document.location.href.indexOf("?")!="-1") {
      document.write("<center>"+document.location.href.split("=")[1]+"<br><input type=button onclick=window.close() value=OK></center>");
    } else {
      document.write('<a href=JavaScript:alert("dasdas")>fdsfds</a>');
    }
    </script>
    </BODY>
    </HTML>
      

  3.   

    a.html
    <script language=javascript>
    window.showModalDialog("b.html","","height=150,width=500,top=250,left=250,resizable=yes,toolbar=yes,scrollbars=no,menubar=yes,location=no");
    history.go(-1);
    </script>b.html
    <HTML>
    <HEAD>
    <TITLE></TITLE>
    </HEAD>
    <BODY><P>Sorry,Maybe your account or password is wrong!</P>
    <input type=button value="OK" onclick="window.close();"></BODY>
    </HTML>