gpt4 book ai didi

javascript - "Operation Aborted"IE 11 中的 JavaScript 错误

转载 作者:行者123 更新时间:2023-12-02 16:48:34 25 4
gpt4 key购买 nike

使用{track.js}我注意到有人使用 IE 11 生成了大量“操作中止”错误。此问题在 IE 7 中很常见,但为 resolved in IE 8 。它在 IE 11 中回归了吗?可能是什么原因造成的?

最佳答案

我知道你问这个问题已经很长时间了,但我只是在研究同一问题时偶然发现了这个帖子。我的感觉是,这与早期版本的 IE 中的错误相同。这里很好地解释了:http://www.nczonline.net/blog/2008/03/17/the-dreaded-operation-aborted-error/

You can fix the problem in several ways:

  1. Move the script element so that it’s a direct child of body.
  2. Use insertBefore() to insert the div at the beginning of body instead of the end.
  3. Wait until the page is loaded before attempting to manipulate document.body.

该帖子下的评论也很有用:

Another solution is to add the defer attribute to the script tag. This will make the script to execute when the DOM is completely loaded.

IE throws this error when you try to manipulate the DOM before its completely loaded.

关于javascript - "Operation Aborted"IE 11 中的 JavaScript 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26890842/

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