confirm()如果确定,返回true
如果取消,返回false

解决方案 »

  1.   

    alert()  "确定" return True "or False";
    confirm() "确定" return true; "取消" return false;
      

  2.   

    return confirm("are you ok?");
      

  3.   

    <script>
    alert((window.confirm("ok?"))?"ok":"no ok");
    </script>
      

  4.   

    原页面
    Sub anc_onMouseUp()
    Dim varRet
    varRet=window.showModalDialog(strPath,,"dialogwidth:400px;dialogheight:300px;dialogtop:234px;dialogleft:362px") If Trim(varRet) <> "" Then

    Document.All.Item("spnMeik").innertext = varRet

    End If
    End Sub
    谈出页面
    Sub img_onClick() Window.Parent.ReturnValue = "true"
    Window.Parent.CloseEnd Sub
      

  5.   

    if (confirm("Are you sure?"))
        alert("这家伙点了确定。") ;
    else
        alert("这家伙心虚跑了。") ;