如何聆听twitter中动态加载的推文? [英] how to listen to tweets loaded dynamically in twitter?
问题描述
我试图通过构建一个Chrome插件来为我的时间线中的每条推文添加图片。目前该插件适用于页面刷新时加载的推文。但是,如何扩展插件以包含在我的时间轴中动态加载的新推文和过时推文?
您可以使用 setInterval()
或搜索如果有任何事件在推文后被Twitter脚本调用。
还有一些看起来相关的事件,但我没有对它们进行测试,例如: 编辑: 我看到 Twitter使用jQuery 。 jQuery依次具有 I am trying to add an image to every tweet in my timeline by building a chrome plugin. Currently the plugin works for tweets loaded when the page is refreshed. But how do i extend the plugin to include the "new tweets" and the "past tweets" which are dynamically loaded in my timeline? You can check for them periodically using There are also some events that look relevant, but I did not test them, eg.: EDIT: I see that Twitter uses jQuery. jQuery in turn has 这篇关于如何聆听twitter中动态加载的推文?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
DOMNodeInserted
- 将节点添加为另一个节点的子节点时触发
jQuery.ajaxPrefilter()
在AJAX请求发出之前调用的 jqXHR
对象(我猜想它是 XMLHttpRequest
对象)取决于它会返回什么不同的东西。请参阅 jQuery.ajaxPrefilter()
和有关 XMLHttpRequest
的文档。 setInterval()
or search if there is any event that is called by Twitter script after pulling tweets.
DOMNodeInserted
- fires when a node has been added as a child of another node,jQuery.ajaxPrefilter()
function that is called before AJAX request is being made. You can probably use it to bind your event to the jqXHR
object (which is XMLHttpRequest
object, I suppose) and do different things depending on what it will return. See the documentation of jQuery.ajaxPrefilter()
and the documentation on XMLHttpRequest
.