tags:

views:

1450

answers:

1

I am a big fan of jQuery and I use it for 95% of all my Javascript needs. However, I am a loading a live page using a COMET method; where in Javascript I retreive the data using AJAX at the point where req.readyState == 3. I was curious if it's possible to do this with jQuery $.ajax too (I couldn't find anything in the documentation).

+1  A: 
var xhr = $.ajax(...);

xhr._onreadystatechange = xhr.onreadystatechange;

xhr.onreadystatechange = function() {

     xhr._onreadystatechange();
     if (xhr.readyState == 3) alert('Interactive');
};