<script>
function aa()
{
if (confirm("你确定关闭吗?"))
  return true;
else
  return false;
}
aa();
</script>

解决方案 »

  1.   

    如果你想做一个定制的
    用一个html然后里面可以动态生成你想要的ok,cancel等按钮
    然后把这个html用showmodeldailog()显示出来
    这会有很好的效果
      

  2.   

    Try:
    1.htm:
    <script>
    var newWin = window.open("new.htm","","fullscreen=yes");
    newWin.moveTo(300,200);
    newWin.resizeTo(300,200);
    </script>
    /////////////////////////////////////////////////////////
    new.htm:
    <body scroll=no bgcolor=#cccccc onblur='focus()'><center>提示框
    <br><hr>
    <input type=button value=关闭 onclick='window.close()'></body>
      

  3.   

    window.alert("Here is important!");
    or
    if(window.confirm("Do u know here is important?"))
    {
         //some code here
    }
    else
    {
         //some code here 
    }
      

  4.   

    JScript提供了Window.alert()

    Window.confirm()提示对应框