【问题标题】:Show a confirmation dialogue for a specific amount of time?显示特定时间的确认对话框?
【发布时间】:2017-06-17 12:55:03
【问题描述】:

我想只显示一个特定时间的确认对话框,以便在用户使用时结束

a) 离开页面

b) 没有在特定时间回答

var acception = confirm("Accept?");

if(acception == true){
    changeStatus("accepted");
}
else{
    changeStatus("denied");
}

【问题讨论】:

    标签: javascript php jquery html ajax


    【解决方案1】:

    您不能通过脚本关闭javascript alertconfirm 框。您可以使用jquery dialog 框代替确认框。 jQuery:

      <script>
      $( function() {
        $( "#dialog" ).dialog();
        //To close you can use settimeout
        window.setTimeout(
        function() { 
        $('#dialog').dialog('close'); 
        }, 10000);
      });
      </script>
    

    如果您想确认返回 true 或 false 的消息意味着您可以refer here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-28
      • 2022-11-07
      • 1970-01-01
      • 1970-01-01
      • 2016-02-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多