以下jQuery帖子在Internet Explorer中占用了大量时间,但在Chrome中却没有。该方法在其他页面中立即生效。这种方法对所有页面都是通用的。
function checkSession() {
debugger;
var checkSessiontUrl = '@Url.Action("CheckSession", "Home", null, Request.Url.Scheme)';
var logoutUrl = '@Url.Action("LogOut", "Home", null , Request.Url.Scheme)';
noProgressLoaderRequired = true;
$.ajax({
url: checkSessiontUrl,
data: {
uniqueId: '@Session["UniqueId"]'
},
type: "POST",
cache: false,
dataType: 'json',
success: function(data) {
if (data != true) {
debugger;
isInsideApplication = true;
window.location.href = logoutUrl;
}
noProgressLoaderRequired = false;
},
error: function(xhr, ajaxOptions, thrownError) {
//alert('Ajax failure');
isInsideApplication = true;
window.location.href = logoutUrl;
noProgressLoaderRequired = false;
}
});
}