2013-10-08 34 views
-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部分的語法可能是錯誤的。任何建議表示讚賞。

回答

0

https://github.com/mikesherov/jquery-idletimer/blob/master/src/idle-timer.js是一個HTML文件,沒有JavaScript。

另外http://code.jquery.com/jquery-1.9.x.js是404-