gpt4 book ai didi

javascript - 为什么 DOM 级别 3 中不推荐使用 DOMSubtreeModified 事件?

转载 作者:IT王子 更新时间:2023-10-29 03:01:10 33 4
gpt4 key购买 nike

为什么 DOMSubtreeModified 事件是 deprecated我们应该用什么代替?

最佳答案

如果你scroll down a bit ,你看:

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 是 mutation observers , 完全指定 in the DOM Living Standard这取代了所有 DOM 级别 X 的愚蠢行为。

关于javascript - 为什么 DOM 级别 3 中不推荐使用 DOMSubtreeModified 事件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6659662/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com