سؤال

I am trying to set up an automatic logout for users who are idle a predetermined length of time on a given page. I'm using jade files to do the layout for my html pages. I tried to link the idleTimer plug-in directly into the file. This is what my jade file looks like:

!!!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");
                });
            });

I'm just trying to get the functionality of the plug in going at this point, not coding anything to actual log a user out. When running this with Express and loading a page no alerts are being generated. I'm not sure if the way I'm including JQuery and the plug-in are correct, or maybe if the syntax of the JQuery section in the jade file might be wrong. ANy advice is appreciated.

هل كانت مفيدة؟

المحلول

https://github.com/mikesherov/jquery-idletimer/blob/master/src/idle-timer.js is a HTML file, no JavaScript.

Also http://code.jquery.com/jquery-1.9.x.js is 404-

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top