$(document).ready(
function() {
$("body").ajaxError(
function(e,request) {
if (request.status == 400) {
//window.location.reload();
//window.location.href = "/myapp/login";
// handle it as you wish
}
}
);
}
);
This is called for all you ajax requests and prevents your page from displaying the login screen in ajax requests.