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
Post a Comment