在IE11中获取JavaScript数组错误 [英] Getting error in IE11 for javascript array

查看:83
本文介绍了在IE11中获取JavaScript数组错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我仅在IE Edge中收到此错误.除此浏览器外,它还可在所有其他浏览器中使用.我想找出导致此错误的原因:

I get this error below only in IE edge. It works in all other browser apart from this one. I want to figure out what is causing this error:

代码而不是屏幕截图:

var ui_tabsets = new Array();

导致错误:

对象不支持此操作.

Object doesn't support this action.

推荐答案

错误是无法找到Array构造函数.这意味着在其他地方出了问题.可能是您关闭了正在运行的iframe或使您的HttpContext丢失的东西,此问题更多地出现在错误Can't execute code from a freed script上.如果您尝试在上下文外部调用函数,并且Web浏览器将不像IE那样急于破坏上下文,则Webkit浏览器将为您创建一个新的HttpContext.

The error is that the Array constructor cannot be found.. This means something has gone wrong elsewhere. Perhaps you've closed an iframe this was running on or something that's lost you your HttpContext, more often this issue manifests with the error Can't execute code from a freed script. Webkit browsers will create you a new HttpContext if you try to call a function outside of a context and doesn't destroy contexts as eagerly as IE does so this issue probably won't occur in those browsers.

要找出问题出在哪里,请在调试器中为Array创建监视,并逐步执行引导至此行的代码,有时您会发现Array消失了.确定该行代码如何/为什么释放您的上下文.

To find out where the problem is, create watches for Array in the debugger and step through the code leading up to this line, at some point you'll notice Array has gone. Work out how/why that line of code is releasing your context.

这篇关于在IE11中获取JavaScript数组错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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