为什么 DOMSubtreeModified 事件在 DOM 级别 3 中被弃用? [英] Why is the DOMSubtreeModified event deprecated in DOM level 3?

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

问题描述

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

解决方案

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

<块引用>

警告!MutationEvent 接口是在 DOM Level 2 中引入的事件,但尚未完全和互操作实施跨用户代理.此外,也有人批评说界面,按照设计,引入了性能和实现挑战.一个新的规范正在开发中,目的是解决突变事件解决的用例,但更多性能方式.因此,本规范描述了突变事件用于遗留行为的参考和完整性,但弃用使用 MutationEvent 接口和 MutationNameEvent界面.

替代 API 是 突变观察者,它们完全指定在 DOM 生活标准中取代所有 DOM 级别 X 愚蠢.>

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

解决方案

If you scroll down a bit, you see:

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.

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天全站免登陆