gpt4 book ai didi

javascript - 最佳 DOMContentLoaded 回退

转载 作者:行者123 更新时间:2023-11-29 22:10:43 28 4
gpt4 key购买 nike

回退

document.addEventListener('DOMContentLoaded',function(){/*code here*/})

最佳答案

来自 MDN :

Internet Explorer 8 supports the readystatechange event, which can be used to detect that the DOM is ready. In earlier version of Internet Explorer, this state can be detected by regularily trying to execute document.documentElement.doScroll("left"), as this snippet will throw an error until the DOM is ready.

关于javascript - 最佳 DOMContentLoaded 回退,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18197045/

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