0 Replies Latest reply on Nov 11, 2008 11:50 AM by pradeepta

    abort ajax request when window is closed

    pradeepta

      We are facing a strange problem when other applications in the enterprise launch into our application.

      Summary : When the window of Internet Explorer is closed with an AJAX call still pending, we will have to restart the browser. This is due to an existing garbage-collection bug in IE. When a document references JavaScript, and the JavaScript references back to the document (which is pretty much all the time with AJAX) then closing the document won't cause the JavaScript to be terminated.

      Some of the areas where this problem might be caused are exit buttons which uses only onclick to close the application. We modified them to jsf buttons as the window.close is a client call. This part resolved a part of the problem.

      As per the solution provided we need to abort XmlHttpRequestObject requests when we close window in between some process. As we are using richfaces framework for making ajax calls, we still are investigating what could be done to abort a call in case the actor decides to close the browser before the process is finished.

      Could anyone direct us what might be the possible ways in order for us to achieve this.

      Thanks.