idleTimer will not work, timer never starts “has no method on” when inspected

StackOverflow https://stackoverflow.com/questions/8175236

  •  03-03-2021
  •  | 
  •  

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);
});
有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top