[jQuery] jquery and comet long polling problem with IE

[jQuery] jquery and comet long polling problem with IE


hello,
I wrote a comet servlet, and this is how I get the data into jquery:
function pS() {
$.ajax({
url:'tS',
type: 'GET',
timeout: 100000,
complete: function(xhr, status) {
alert(status);
if(status==='success') {
if(xhr.responseText==='success') {
$('#st_a').text(xhr.getResponseHeader('X-A'));
$('#st_b').text(xhr.getResponseHeader('X-B'));
$('#st_c').text(xhr.getResponseHeader('X-C'));
$('#st_d').text(xhr.getResponseHeader('X-D'));
}
pS();
} else if(status==='timeout') {
setTimeout(function(){ pS(); }, 60000);
} else if(status==='error') {
setTimeout(function(){ pS(); }, 60000);
}
}
});
}
basically pS() is called at document load, and then it calls itself.
if a timeout or error occurs, it will reschedule itself in 60 seconds.
This scheme works fine with FF, but no luck with IE.
what happens is after the first call, (which waits properyly and gets
the result) it gets in to an infinite loop. complete is executed with
status = success. (without actually making the request)
I did some searching and some people proposed inserting 256 bytes of
junk data, to response, i tried this and it did not work
this seems a jquery problem. the reason is, with the same server code,
(grizlly comet count) which uses prototype and behaivor libs, it works
in IE no problem.
Best.
-C.B.