开发者

Jquery-idletimeout error in mvc 2

In my mvc application, on a particular page I am using jquery idletimeout plugin for the session. In my jquery I am getting the error as 'expected ')'. Does anyone see where I should change it?

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<title>ManageEmployeeProfile</title>
<script>
function logout() 
{ 
alert('You are about to be signed out due to Inactivity'); 
window.location = '/Account/Logout'; 
} 

$(document).ready(function() 开发者_开发知识库
{   
 var SEC = 10; 
 var MIN = 6 * SEC; 
 // http://philpalmieri.com/2009/09/jquery-session-auto-timeout-with-prompt/ 
 <% if(HttpContext.Current.User.Identity.IsAuthenticated) {%> 
 $(document).idleTimeout({ 
    inactivity: 30 * MIN, 
    noconfirm : 30 * SEC, 
    redirect_url: 'javascript:logout()', 
    sessionAlive: 0, // 30000, //10 Minutes 
    click_reset: true, 
    alive_url: '', 
    logout_url: '' 
    }); 
 <%} %> 
}
</script>


Missing ); for $(document).ready(function(){...} --->);

$(document).ready(function()

{

 var SEC = 10; 
 var MIN = 6 * SEC; 
 // http://philpalmieri.com/2009/09/jquery-session-auto-timeout-with-prompt/ 
 <% if(HttpContext.Current.User.Identity.IsAuthenticated) {%> 
 $(document).idleTimeout({ 
    inactivity: 30 * MIN, 
    noconfirm : 30 * SEC, 
    redirect_url: 'javascript:logout()', 
    sessionAlive: 0, // 30000, //10 Minutes 
    click_reset: true, 
    alive_url: '', 
    logout_url: '' 
    }); 
 <%} %> 
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜