本文介绍了检测DOM更改事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法检测DOM更改事件?无论是文本替换,移动节点,删除或添加新节点等。

解决方案

我想你是寻找是



编辑:进一步检查此和其他 MutationEvents 已经



请参阅:



长篇小说, DOMSubtreeModifie d 仍然可以正常工作,并且在稳定的浏览器之间没有合理的替代方案。


Is there a way to detect DOM change events? whether it be text replacement, moving a node, removing or adding a new node, etc.

解决方案

I think what you're looking for is DOMSubtreeModified

Edit: upon further inspection this and other MutationEvents have been deprecated by the W3C but there doesn't appear to be a replacement until DOM Level 4

See: "Why is the DOMSubtreeModified event deprecated in DOM level 3?"

Long story short, DOMSubtreeModified will still work and there is no reasonable alternative implemented across stable browsers.

这篇关于检测DOM更改事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-14 22:13