<script language=vbscript>
function az()
if msgbox("提示",vbokcancel)=vbok then
alert("fff")
else
alert("tttt")
end if
end function
</script><input type=button value=aaaa onclick=az()>

解决方案 »

  1.   

    <script>
    alert(confirm('1+1=2?')==true?'对':'错')
    </script>
      

  2.   

    confirm 返回的就是布尔值, 所以不需要 ==true 这样判断的.
    alert(confirm('1+1=2?') ? '对' : '错')
      

  3.   

    但confirm对话框的两个按钮是“确定”、“取消”。而不是“是否”,有点遗憾。
      

  4.   

    To: cxz7531(大花猫) 你可以用 execScript() 调用VBSCRIPT里的 msgbox 重载 confirm()
      

  5.   

    <script>
    if(confirm('1+1=2?')){
    alert("right")
    }else{
    alert("err")
    }
    </script>
      

  6.   

    to meizz(梅花雪) 
    -----------------------
    是这样的吧
    <script language=javascript>
    <!--
    function window.confirm(str){
        execScript("ret = msgbox('"+ str +"', vbYesNo, '信息提示')", "vbscript");
        return(ret == 6);
    }
    alert(confirm('1+1=2?'));
    // -->
    </script>