jquery - Long polling issue with IE8 -


im building app uses long polling technique , im running trouble ie8.

so here simplified code use:

php:

 $time = time();     while((time() - $time) < 10) {         $data = rand(0,10);             // if have new data return         if($data == 3 || $data == 6) {             echo json_encode($data);             break;         }             sleep(1);         } 

js:

var lponcomplete = function(response) {         alert(response);         // more processing         lpstart();     };      var lpstart = function() {         $.post('http://example.com/test', {}, lponcomplete, 'json');     };      $(document).ready(lpstart); 

the problems seems ie8 not waiting til server responds fires next request straight after or dies after first proper response. may cause behavior?

this seemed trick.

$.ajaxsetup ({    cache: false }); 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -