空闲定时器将不起作用,定时器永远不会启动“没有方法”检查时
我正在使用 MVC3、Jquery 1.4.4 和空闲计时器插件。
空闲定时器将不起作用,定时器在检查时永远不会启动“没有方法”
$(document).ready(function () {
//Deals with Idle session
var timeout = 5000;
$(document).bind("idle.idleTimer", function () {
alert('idle');
});
$(document).bind("active.idleTimer", function () {
alert('active');
});
$.idleTimer(timeout);
});
I am using MVC3, Jquery 1.4.4, and idle-timer plugin.
idleTimer will not work, timer never starts "has no method on" when inspected
$(document).ready(function () {
//Deals with Idle session
var timeout = 5000;
$(document).bind("idle.idleTimer", function () {
alert('idle');
});
$(document).bind("active.idleTimer", function () {
alert('active');
});
$.idleTimer(timeout);
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过大约两个小时的查看教程、代码示例并试图找出出错的地方后,我决定考虑可能导致此问题的其他原因。
启动 Chrome 脚本调试器,并遇到错误“no on method”...然后我突然意识到,idleTimer 可能是在较新版本的 jQuery 之上构建的。下载了一个较新的版本,具体来说是1.7,它运行得很好。除了最低 jQuery 要求之外,文档很棒。
After about two hours of looking at tutorials, code examples and trying to figure out where I went wrong, I decided to think about other things that could cause this.
Fired up Chromes script debugger, and came across the error "no on method"...then it hit me, idleTimer may have been built on top of a newer version of jQuery. Downloaded a newer version , 1.7 to be specific, and it works flawlessly. The documentation was great, except for what the minimum jQuery requirement.