【问题标题】:idleTimer plugin doesn't seem to be workingidleTimer 插件似乎不起作用
【发布时间】:2013-10-15 20:47:59
【问题描述】:

我正在尝试为在给定页面上闲置预定时间长度的用户设置自动注销。我正在使用玉文件来为我的 html 页面进行布局。我尝试将 idleTimer 插件直接链接到文件中。这是我的玉文件的样子:

!!!5
html
    head
        title #{title}
        link(rel='stylesheet', href='/stylesheets/style.css')
        script(type="text/javascript", src="http://code.jquery.com/jquery-1.9.x.js")
        script(type="text/javascript", src="https://github.com/mikesherov/jquery-idletimer/blob/master/src/idle-timer.js")
        script.
            $(document).ready(function(){
                $.idleTimer(5000);
                $(document).bind("idle.idleTimer", function(){
                    alert("idle");
                });
            });

此时我只是试图让插件的功能发挥作用,而不是编写任何代码来实际注销用户。当使用 Express 运行它并加载页面时,不会生成任何警报。我不确定我包含 JQuery 和插件的方式是否正确,或者可能是玉文件中 JQuery 部分的语法可能是错误的。任何建议表示赞赏。

【问题讨论】:

    标签: jquery express pug idle-timer


    【解决方案1】:

    https://github.com/mikesherov/jquery-idletimer/blob/master/src/idle-timer.js 是一个 HTML 文件,没有 JavaScript。

    http://code.jquery.com/jquery-1.9.x.js 也是 404-

    【讨论】:

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