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