InnerHTML 的 JQuery 更改事件
就我而言,我正在编写一个 Chrome 扩展,我无法访问页面上发生的其他 JS。因此,我需要确保每当某些元素更新其内容时,我都会从扩展中重新运行函数。
基本上是一个可以由innerHTML 更改触发的Change 事件。
In my case i'm writing a Chrome Extension, I don't have access to the other JS that is happening on the page. So I need to make sure that whenever certain elements update their content I rerun a function from the extension.
Basically a Change event that can be triggered from innerHTML changing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于它是针对 Chrome 扩展的,因此也可以采用标准 DOM 突变事件。
监听
document
上的DOMSubtreeModified
。刚刚在 Chrome 5.0.375.99 上测试,支持。Since it's for a Chrome extension, might as well the standard DOM Mutation events.
Listen to
DOMSubtreeModified
on thedocument
. Just tested on Chrome 5.0.375.99 and it is supported.