gpt4 book ai didi

javascript - deleteCell 会导致伪泄漏吗?

转载 作者:行者123 更新时间:2023-11-30 18:30:09 25 4
gpt4 key购买 nike

根据 this website打电话removeChild()在 JavaScript 中导致称为伪泄漏的 Internet Explorer 特定泄漏。

Sometimes Internet Explorer keeps items in memory after the page is done using them. Although these pseudo-leaks are freed after the user leaves the page, some web pages may be open for long periods of time. To avoid pseudo-leaks, do not use removeChild to remove elements. Instead, set the parent's innerHTML to ""

是否deleteCell()以与 removeChild() 相同的方式导致伪泄漏?

编辑:我能够在 IE8 上重现此错误。信不信由你,微软声称已经在 IE7 中解决了这个问题。

最佳答案

我没有能够查看 IE 的源代码并确认的好处,但我想如果它像 Chrome 实现 deleteCell 的方式一样,它在内部使用 removeChild,这可能会触发 IE 的伪泄漏。我知道旧版本的 IE 有这个问题,但我不确定当前版本是否有。

来自 Chrome 来源:

void HTMLTableRowElement::deleteCell(int index, ExceptionCode& ec)
{
...
HTMLElement::removeChild(cell.get(), ec);
}

关于javascript - deleteCell 会导致伪泄漏吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9878557/

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