【问题标题】:IE9 throws the error: 'Error: An internal error occurred in the Microsoft Internet extensions' when running angular appIE9 在运行 Angular 应用程序时抛出错误:“错误:Microsoft Internet 扩展中发生内部错误”
【发布时间】:2014-06-16 01:21:01
【问题描述】:
I'm getting the error in IE9 when loading my app: 

错误:Microsoft Internet 扩展中出现内部错误 错误:访问被拒绝。

当我在 IE 的开发工具中调试时,它指向关于 localStorage 的代码。

if (localStorage) {
  // some code
} else {
  // some code
}

我不确定这是 Angular IE 问题,还是只是与 IE 相关。提前致谢!

【问题讨论】:

标签: javascript angularjs internet-explorer-9 local-storage console.log


【解决方案1】:

您是否在本地运行您的应用程序? IE9 不支持本地文件的本地存储。

这个问题有很多进一步的解释: local storage in IE9 fails when the website is accessed directly from the file system

【讨论】:

  • 我不在本地测试我们的开发服务器,但仍然不断收到错误。
  • 您是否也在您的开发服务器上查看该站点,或者您是否正在使用 http:///whatever.html 从另一台机器查看它?
  • 我正在从另一台机器上查看它
  • 您可以尝试确保您用于加载网站的机器以管理员权限运行。您还可以检查 IE 设置以确保未启用保护模式(在 Internet 选项 -> 安全下)。 IE 对本地存储的支持很不稳定,因此您可能需要在代码中专门对其进行测试:if(localStorage === "undefined") 而不是您最初的方式。
  • 您可能已经发现 - IE9 (caniuse.com/cors) 仅部分支持 CORS。听起来您可能想问一个有关 XDomain 的新问题,以便让您走得更远。
猜你喜欢
  • 1970-01-01
  • 2013-03-07
  • 2019-01-01
  • 2020-06-24
  • 1970-01-01
  • 2017-06-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多