i have an app (struts2+sprin+glassfish3.1.2) that sends an ajax (jquery) requests every second to the server. If certain conditions are met my js redirects me to other page, otherwise i do nothing.
It seems that after a long period (couple of hours without any redirect) the browser become unresponsive or it take a very long to time perform a request.
I mention that if when this happens i close the browser from the X and reopen it everything is ok. I did not manage to replicate this problem in my test environment, but it seems the i have this problem in production :( .
any ideea ?
i use Jquery (struts2-jquery-plugin3.3.0) for ajax calls,i will attach some of the code:
this method is accessed every 1 second :
function checkedForAnsweredCalls(){
if (ajaxFinished == 1){
ajaxFinished = 0;
$.getJSON( redirectToTicket.html ,
function(data) {
ajaxFinished = 1;
if (data != null){
window.location = data;
}
}
);
}
};
by this piece of code:
<script>
var ajaxFinished = 1;
window.setInterval( "checkedForAnsweredCalls()", 1000 );
</script>
this ajax code access a struts2 action that has a json response type, so if some database conditions are met i get back an url.
thanks for the quick responses.