为什么DOMSubtreeModified事件在DOM 3级不推荐使用? [英] Why is the DOMSubtreeModified event deprecated in DOM level 3?

查看:1189
本文介绍了为什么DOMSubtreeModified事件在DOM 3级不推荐使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么DOMSubtreeModified事件已弃用,我们是什么应该使用?

Why is the DOMSubtreeModified event deprecated and what are we supposed to use instead?

推荐答案

如果您向下滚动一下,你会看到:


警告!在DOM Level 2
事件中引入了 MutationEvent 接口,但是尚未完全可互操作地在用户代理程序之间实现
。另外,还有一些批评说,
接口的设计引入了一个性能和实现
的挑战。目前正在开发一个新的规范,目的是为了解决突变事件解决的用例,但是以
的表现方式。因此,本规范描述了突变事件
,以供参考和遗留行为的完整性,但不推荐
使用 MutationEvent 接口和 MutationNameEvent
接口。

Warning! The MutationEvent interface was introduced in DOM Level 2 Events, but has not yet been completely and interoperably implemented across user agents. In addition, there have been critiques that the interface, as designed, introduces a performance and implementation challenge. A new specification is under development with the aim of addressing the use cases that mutation events solves, but in more performant manner. Thus, this specification describes mutation events for reference and completeness of legacy behavior, but deprecates the use of both the MutationEvent interface and the MutationNameEvent interface.

替换API是突变观察者,它们完全指定中的.whatwg.org /#mutation-observersrel =noreferrer>,它们取代了所有的DOM级别X的愚蠢。

The replacement API is mutation observers, which are fully specified in the DOM Living Standard that supercedes all of the DOM level X silliness.

这篇关于为什么DOMSubtreeModified事件在DOM 3级不推荐使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆