gpt4 book ai didi

AngularJS 和怪癖模式 : blank screen on IE8+

转载 作者:行者123 更新时间:2023-12-01 23:23:46 25 4
gpt4 key购买 nike

我正在处理一个 Angular 项目,该项目将包含在我无法控制的 HTML 页面中。实际上我只能访问 <body> 里面的内容元素。

有许多约束不是最容易处理的:1-我无法更改文档类型: 2- 我无法删除此元标记: 3- 应用程序必须加载 XML 文件

我设法克服了第 1 点和第 3 点,但第 2 点让我头疼!这是我在 IE8+ 上测试时遇到的错误(它在 IE7 和其他浏览器上工作正常):

[$sce:iequirks] http://errors.angularjs.org/1.2.12/$sce/iequirks IE8 in quirks mode is unsupported error in component $sce Strict Contextual Escaping does not support Internet Explorer version < 9 in quirks mode. You can fix this by adding the text to the top of your HTML document. See http://docs.angularjs.org/api/ng.$sce for more information.

我在论坛上找到了很多解决方案,但到目前为止还没有一个有效...特别希望禁用 $sceProvider(下面的代码)将使该应用程序在 IE8+ 上运行,但它没有:

angular.module('ie7support', []).config(function($sceProvider) {
// Completely disable SCE to support IE7.
$sceProvider.enabled(false);`
});

我什至尝试添加 <!doctype html>到我的 HTML 文档的顶部,这是我不允许的,但我只是为了测试才这样做,但它并没有解决问题。

非常感谢任何帮助或建议,因为我现在真的卡住了......

谢谢

最佳答案

知道了!!

我只需要在下面的代码中提供我的应用程序的名称,而不是愚蠢的“ie7support”:

angular.module('ie7support', []).config(function($sceProvider) {
// Completely disable SCE to support IE7.
$sceProvider.enabled(false);
});

通过深入阅读本文发现: http://docs.angularjs.org/api/ng .$sce

希望对大家有所帮助!

关于AngularJS 和怪癖模式 : blank screen on IE8+,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21740857/

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