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: ''
});
<%} %>
});
精彩评论