confirm是浏览器给出的接口除非让用户使用你自己开发的浏览器否则没法由你定义它的外观

解决方案 »

  1.   

    use showModalDialog to custome your confirm dialog.
      

  2.   

    page1:<HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    </HEAD><BODY>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function test() {
     var win = window.showModalDialog("customDialogForm.html","win","dialogWidth:220px;dialogHeight:130px;help:no;status:no;name:test");
     if (win) {
    alert("Hello World!");
     } else {
    alert("Go to hell!");
     }
     }
     function testAlert() {
    var win = window.showModelessDialog("customDialogFormAlert.html","win","dialogWidth:220px;dialogHeight:130px;help:no;status:no;name:test");
    if (win) {
    alert("test");
    }
     }
     function testAlert1() {
    var win = window.showModalDialog("customDialogForm2.html","win","dialogWidth:220px;dialogHeight:130px;help:no;status:no;name:test");
     if (win==true) {
    alert("Hello World!");
     } else if(win==false) {
    alert("Go to hell!");
     } else {
    return;
     }
     }
    //-->
    </SCRIPT><FORM METHOD=POST ACTION="">
    <input type=button value="test Confirm" onclick="test()"><br><br><br>
    <input type=button value="test alert" onclick="testAlert()"><br><br><br>
    <input type=button value="Three checks" onclick="testAlert1()"><br><br><br>
    </FORM>
    </BODY>
    </HTML>
    page2:
    <HTML>
    <HEAD>
    <TITLE> Dialogue </TITLE>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function doYes() {
    window.returnValue = true;
    window.close();
    }
    function doNo() {
    window.returnValue = false;
    window.close();
    }
    //-->
    </SCRIPT></HEAD><BODY style="background-color:#d8d8d0">
    <FORM METHOD=POST >
    <table width="100%"  border="0" cellspacing="5" cellpadding="0">
      <tr>
        
        <td colspan="5" align="center">Are you sure to quit? </td>
        
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td width="15%">&nbsp;</td>
        <td width="7%">&nbsp;</td>
      <td width="16%">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td align="right">&nbsp;</td>
        <td align="right"><INPUT name="button2" type=button style="width:50;cursor:hand;BORDER-RIGHT: #000000 3px solid; BORDER-TOP: #ffffff 3px solid; BORDER-LEFT: #ffffff 3px solid; COLOR: #000080; BORDER-BOTTOM: #000000 3px solid; BACKGROUND-COLOR: #d8d8d0;" value="Yes" onclick="doYes()"></td>
        <td align="left">&nbsp;</td>
      <td align="left"><INPUT name="button" type=button style="width:50; cursor:hand;BORDER-RIGHT: #000000 3px solid; BORDER-TOP: #ffffff 3px solid; BORDER-LEFT: #ffffff 3px solid; COLOR: #000080; BORDER-BOTTOM: #000000 3px solid; BACKGROUND-COLOR: #d8d8d0;" value="No" onclick="doNo()"></td>
        <td align="left">&nbsp;</td>
      </tr>
    </table>
    </FORM>
    </BODY>
    </HTML>