AngularJS和怪癖模式:IE8空白屏幕+怪癖、空白、屏幕、模式

2023-09-13 03:25:22 作者:屿森曦光

我的工作,这将被包含在HTML页面中我没有控制上的角项目。其实我只是有机会获得什么&LT内部;身体GT; 元素。

I'm working on an Angular project that will be included in a HTML page I don't have control on. Actually I only have access to what is inside the <body> element.

有许多制约因素这是不是最简单的处理:1 - 我不能改变的文档类型:    2 - 我无法删除此meta标签:    3应用必须加载XML文件

There are many constraints which are not the easiest to deal with: 1- I can't change the doctype: 2- I can't remove this meta tag: 3- The app has to load an XML file

我设法克服点1和3,但2点让我头疼!下面是我得到的,当我在IE8 +测试错误(正常工作在IE7等浏览器):

I managed to overcome points 1 and 3 but point 2 gives me a headache ! Here is the error I get when I test on IE8+ (it works fine on IE7 and other browsers):

[$ SCE:iequirks] http://errors.angularjs.org/1.2.12/ $ SCE / iequirks  IE8怪癖模式不支持  错误组件$ SCE  严格的语境转义不支持Internet Explorer版本&LT; 9怪癖模式。您可以通过添加文本到您的HTML文档的顶部解决这个问题。请参见 http://docs.angularjs.org/api/ng 。$ SCE以获取更多信息。

[$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(code以下)将作出IE8 +应用程序的工作,但事实并非如此:

I found many solutions on forums but no one has worked so far... Especially hoped that disabling $sceProvider (code below) would make the app work on IE8+ but it didn't:

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

我甚至尝试添加&LT;!DOCTYPE HTML&GT; 来我的HTML文件,我不允许,但我就是这样做的测试的顶部,它并没有解决问题。

I even tried to add <!doctype html> to the top of my HTML document, which I am not allowed to but which I did just for the test, and it doesn't solve the problem.

任何帮助或建议,大大AP preciated原因我真的很坚持现在...

Any help or suggestions greatly appreciated cause I'm really stuck right now...

感谢

推荐答案

明白了!

我只是需要给我的应用程序,而不是傻ie7support下code的名称:

I simply needed to give the name of my app instead of silly "ie7support" in the code below:

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

由于发现在这篇文章深入了解: http://docs.angularjs.org/api/ng 。$ SCE

希望它可以帮助一些你!

Hope it can help some of you !