-1
我想为给定页面上闲置预定时间长度的用户设置自动注销。我正在使用jade文件为我的html页面进行布局。我试图将idleTimer插件直接链接到文件中。这是我的玉文件看起来是这样的: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和插件的方式是否正确,或者如果jade文件中的JQuery部分的语法可能是错误的。任何建议表示赞赏。