JQuery 1.9 - Internet Explorer 9 freezes after the first $ ajax request

For a dynamic page, I use Ajax Long Polling and even with jQuery 1.9, Internet Explorer freezes after the first request.

The script code is based on the article Simple Long Survey Using JavaScript and jQuery

 <script type="text/javascript" charset="utf-8"> 
   $(document).ready(function(){ 
     (function poll(){
       $.ajax({ url: "ajaxstats.json", success: function(data){
         $("button.requests" ).empty().append(data.requests);
   }, dataType: "json", complete: poll, timeout: 30000 });
     })();
   });
 </script>

The console does not show errors.

IE Network Monitor immediately shows many resource requests ajaxstats.jsonwith response times <1 ms and 304 (not modified). The response body is correct (JSON code).

Server code always delays the response by 1000 milliseconds. And in Firefox, the Firebug XHR log shows that each request takes about 1000 milliseconds, as expected.

The HTTP response code is different from Firefox and Internet Explorer:

  • in Firefox: response code 200 ok
  • Internet Explorer 9, 304 (not modified)

IE?

+5
3

cache param false, false, .

 <script type="text/javascript" charset="utf-8"> 
   $(document).ready(function(){ 
     (function poll(){
       $.ajax({ url: "ajaxstats.json", success: function(data){
         $("button.requests" ).empty().append(data.requests);
   }, dataType: "json", complete: poll, timeout: 30000, cache: false });
     })();
   });
 </script>
+7

setTimeout . timeout - , .

, .

+3

, IE9 , , IE9 . , ajax. , , ajax 5 IE9, Firefox, .

, , Socket.IO. http://socket.io/ node.js, .

:

  • WebSocket
  • Adobe Flash Socket
  • AJAX
  • AJAX
  • Forever Iframe
  • JSONP

-, , , , -, Socket.IO.

+1

All Articles