“操作中止"指的是“中止操作". IE 11中的JavaScript错误
使用 {track.js} 时,我注意到使用IE 11的用户会产生大量中止操作"错误.此问题在IE 7中很常见,但在IE 8中已解决.它是否在IE 11中重新出现?可能是什么原因造成的?
Using {track.js} I noticed someone using IE 11 generated a ton of "Operation Aborted" errors. This issue was common in IE 7 but was resolved in IE 8. Did it come back in IE 11? What could be causing this?
我意识到距您提出要求已经有很长时间了,但是当我研究同一问题时,我偶然发现了这个线程.我的感觉是,它与早期版本的IE中存在相同的错误.在这里很好地解释了: http://www. nczonline.net/blog/2008/03/17/the-dreaded-operation-aborted-error/
I realise it has been a long time since you asked, but I just stumbled upon this thread when I was researching the same issue. My feeling is that it's the same error as in earlier versions of IE. Nicely explained here: http://www.nczonline.net/blog/2008/03/17/the-dreaded-operation-aborted-error/
您可以通过多种方式解决此问题:
You can fix the problem in several ways:
- 移动脚本元素,使其成为body的直接子元素.
- 使用insertBefore()在div的开头而不是结尾处插入div.
- 在尝试操作document.body之前,请等待页面加载完毕.
- Move the script element so that it’s a direct child of body.
- Use insertBefore() to insert the div at the beginning of body instead of the end.
- Wait until the page is loaded before attempting to manipulate document.body.
该帖子下的评论也很有用:
The comment under that post is useful as well:
另一种解决方案是将
defer
属性添加到script
标签.这将使脚本在DOM完全加载时执行.
Another solution is to add the
defer
attribute to thescript
tag. This will make the script to execute when the DOM is completely loaded.
当您尝试在DOM完全加载之前对其进行操作时,IE会引发此错误.
IE throws this error when you try to manipulate the DOM before its completely loaded.