为了账号安全,请及时绑定邮箱和手机立即绑定

将 jQuery 对话框合并到 JavaScript 中时未打开

将 jQuery 对话框合并到 JavaScript 中时未打开

12345678_0001 2021-06-16 09:06:39
我在 JavaScript 函数中使用 jQuery 以显示对话以显示会话超时弹出窗口。出于某种原因,模型对话框根本没有打开。我尝试移动 div 并尝试以 Internet 上显示的不同方式调用 jQuery,但仍然没有打开模型对话框。timeout_popup_function = null;function checkSession() {    alert('Check session is called');    var sessionExpiry = Math.abs(getCookie('sessionExpiry'));    var timeOffset = Math.abs(getCookie('clientTimeOffset'));    var localTime = (new Date()).getTime();    alert("localTime is@@" + localTime);    if (localTime - timeOffset > (sessionExpiry + 15000)) {        var mins = 1;  //Set the number of minutes you need        var secs = mins * 60;        var currentSeconds = 0;        var currentMinutes = 0;        timeout_popup_function();        setTimeout(Decrement(secs), 1000);    }    else {        setTimeout('checkSession()', 10000);    }};setInterval(checkSession, 30000);$(function($) {    function ShowTimeoutWarning() {        alert('222');        //$("#timeoutdialog").dialog("open");        $("#timeoutdialog").dialog({            autoOpen: false,            dialogClass: "no-close",            position: 'center',            title: 'session',            draggable: false,            width: 300,            height: 200,            resizable: false,            modal: true,            buttons: [{                text: "OK",                click: function() {                    ShowTimeoutWarning();                    $(this).dialog("close");                }            }]        });        //return false;    }    timeout_popup_function = ShowTimeoutWarning;})HTML:<div id="timeoutdialog" title="Session Expiry"     style="display:none">    <p>        Your session will expire in</p>        <p id="timerText">30</p>        <p>. If you wish to extend your            session, please click extend.        </p></div>我在这里缺少什么?
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 104 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信