“操作中止"指的是“中止操作". IE 11中的JavaScript错误 [英] "Operation Aborted" JavaScript error in IE 11

查看:70
本文介绍了“操作中止"指的是“中止操作". 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:

  1. 移动脚本元素,使其成为body的直接子元素.
  2. 使用insertBefore()在div的开头而不是结尾处插入div.
  3. 在尝试操作document.body之前,请等待页面加载完毕.
  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.

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

The comment under that post is useful as well:

另一种解决方案是将defer属性添加到script标签.这将使脚本在DOM完全加载时执行.

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.

当您尝试在DOM完全加载之前对其进行操作时,IE会引发此错误.

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

这篇关于“操作中止"指的是“中止操作". IE 11中的JavaScript错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆