<SCRIPT LANGUAGE="JavaScript">
function window.confirm()
{
if (arguments.length>0)
   text = arguments[0];
    feature = "dialogWidth:260px;dialogHeight:100px;help:no;status:no";
    return showModalDialog("confirm.htm",text,feature);
}alert(window.confirm("确实要关闭吗?") == true );
</SCRIPT>--------confirm.htm-----------------<style>
body { margin:0;background:menu;text-align:center;font-size:12px;}
#text {margin:10px 20px;height:20px;}
input {width:50px;heigth:20px}
</style>
<body>
<div id="text">
</div>
<div>
<input type="button" value="是" onclick="_return(true)">
&nbsp;&nbsp;
<input type="button" value="否" onclick="_return(false)">
</div>
<script>t = window.dialogArguments;
document.getElementById("text").innerText = t;function _return(bool)
{
window.returnValue = bool;
window.close();
}
</script>
</body>

解决方案 »

  1.   

    重载DOM里的confirm
    <script language=javascript><!--
    /*@cc_on @*/
    /*@if (@_win32 && @_jscript_version>=5)
    function window.confirm(str)  //Author: meizz
    {
        str=str.replace(/\'/g, "'&chr(39)&'").replace(/\r\n|\n|\r/g, "'&VBCrLf&'");
        execScript("n = msgbox('"+ str +"', 4, '自定的的 confirm')", "vbscript");
        return(n==6);
    }
    @end @*/
    alert(confirm('1.\'第一行\';\r\n2.第二行;\r\n'));
    // --></script>