开发者

Completed event for Ajax calls?

Is there some event that fires when an ajax request is completed? Even if it's not standard, as long it works on Firefox or Google Chrome.

Note: I didn't start the request, "someone else" did. It is not us开发者_StackOverflow中文版ing jQuery.


The reason I want this is because websites like facebook aren't updating the whole page, so it doesn't fire the window.onload. This is becoming an issue to develop addons. It is hard to check the page and inject the script. If there were some event like window.onajaxcompleted it would be easier to inject the scripts.

I know there is one event that check for DOM changes, that is not exactly what I need, but it is one workaround.


  xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
     alert('Success');
    }
  }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜