简体   繁体   English

Javascript将功能绑定到Ajax加载事件

[英]Javascript Bind function to Ajax load event

I am trying to write an chrome extension that interacts with Twitter pages however I am having a hard time firing off the function when the twitter stream is ready because it is dynamically loaded after the document is ready. 我正在尝试编写一个与Twitter页面交互的chrome扩展程序,但是当Twitter流就绪时,我很难启动该功能,因为在文档就绪后会动态加载该流。

How can I bind a function to the element being loaded or some sort of generic ajax success response for the element. 如何将函数绑定到要加载的元素或该元素的某种通用ajax成功响应。

current code. 当前代码。 https://github.com/billpull/Twitter-Ticker https://github.com/billpull/Twitter-Ticker

您可以查看.ajaxSuccess ,这是一个全局处理程序,当ajax调用成功时执行(假设ajax调用是通过.ajax完成的)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM