是否可以通过mutationObserver观察节点的innerHTML?我正在尝试使用 characterData: true,但它不会对内容更改进行任何回调。完整的选项列表:
childList: true,
attributes: true,
characterData: true
是否可以通过mutationObserver观察节点的innerHTML?我正在尝试使用 characterData: true,但它不会对内容更改进行任何回调。完整的选项列表:
childList: true,
attributes: true,
characterData: true
嗨,我认为您需要添加
子树:真
在您的选项列表中。
看看https://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#mutation-observers