jQuery 問題 點用jQuery搞comet

原本用readystate === 3 可以收到message
但因為jQuery 無readystate
所以收唔到server push黎既new data..
有冇方法jQuery 做到 comet(http steaming)

  1. var xhr = $.ajax(...);

  2. xhr._onreadystatechange = xhr.onreadystatechange;

  3. xhr.onreadystatechange = function() {

  4.      xhr._onreadystatechange();
  5.      if (xhr.readyState == 3) alert('Interactive');
  6. };
複製代碼
ref: http://stackoverflow.com/questio ... adystate-3-possible

TOP