我正在Windows 7上使用最新的Google Chrome稳定版(19.0.1084.56 m),并首次尝试使用Mutation观察器。 (该项目是第三方网站的用户脚本,我无法访问其服务器。)
碰巧 MutationRecord
有一个字段oldValue
:
record . oldValue
The return value depends on
type
. For "attributes
", it is the value of the changed attribute before the change. For "characterData
", it is the data of the changed node before the change. For "childList
", it is null.
因此,我正在监视characterData
的更改,但是当我获取MutationRecord
时,oldValue
字段始终为null。
它应该可以工作吗,是否有可能我出了点问题,或者此功能太先进了以至于无法正常工作?
在哪里可以找到Google的文档,错误报告,功能请求等内容,这些内容可以声明是否已实现或何时实现?
最佳答案
使用以下方式配置观察者:
observer.observe(container, {
attributeOldValue : true
});
完整的API文档:
https://developer.mozilla.org/pt-BR/docs/Web/API/MutationObserver
关于google-chrome - 我应该使用MutationRecord.oldValue吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11290007/