Ajax causes random crash in IE9

I wrote an internet application that syncs every user action with the server. So I have a lot of Ajax requests (not at the same time).

The app works fine in Firefox and Chrome, but IE9 is giving me a headache. I have completely random crashes in IE9 with these post requests. Therefore, the problem is not reproduced by clear action, but it is common. If, for example, I do the same action ten times in a row, it might succeed every time, or it might fail during one of these requests. I have profiled the network using IE Developer tools and this results in this: http://screencast.com/t/VLcK5OKWQl

As you can see, the post request is pending. In the detailed description of this call, all information is empty, even the request header.

I completely lost this issue. If anyone knows what it might be, please share with me, I'll try something!

By the way, I'm using jQuery (v1.7.1) $ .post calls, if that matters. I also included the following headers in the response file:

header( 'Cache-Control: no-store, no-cache, must-revalidate' );
header( 'Pragma: no-cache' );
header('Content-type: application/json; charset=utf-8');

      

+3


source to share


2 answers


The following headers solved the problem for me:



ob_end_clean();
header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP 1.1.
header('Pragma: no-cache'); // HTTP 1.0.
header('Expires: 0'); // Proxies.
header("Content-type: application/json; charset=utf-8");

      

0


source


I had the same problem and was able to solve it without sending null as data on demand (just sending an integer, etc.).

I also tried to run the same query multiple times to debug what went wrong, and before changing the argument to "non-null" I got random responses (either success, null, or an error (status code 12031) After changing the non-null argument, I was able to execute the same request 1000 times without any glitches.



However, I can't reproduce this anywhere else ... so it doesn't make any sense anyway: P

+1


source







All Articles