Detecting DOM change events

我与影子孤独终老i 提交于 2019-12-02 04:17:39

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/8733306/detecting-dom-change-events

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!