Internet explorer 8 为什么ng class=";ng应用程序“;打破安格拉斯?
为了让AngularJS在IE7和IE8中工作,我将id=“ng app”和class=“ng app”添加到我的ng app元素中:Internet explorer 8 为什么ng class=";ng应用程序“;打破安格拉斯?,internet-explorer-8,cross-browser,internet-explorer-7,angularjs,Internet Explorer 8,Cross Browser,Internet Explorer 7,Angularjs,为了让AngularJS在IE7和IE8中工作,我将id=“ng app”和class=“ng app”添加到我的ng app元素中: <html id="ng-app" class="ng-app" ng-app="myApp"> <div ng-view></div> </html> 这在过去一直有效,但现在我将class=“ng app”添加到两个不同的项目中,并且在这两个项目中,视图不再在任何浏览器中渲染。IE7/8兼容性的方式
<html id="ng-app" class="ng-app" ng-app="myApp">
<div ng-view></div>
</html>
这在过去一直有效,但现在我将class=“ng app”添加到两个不同的项目中,并且在这两个项目中,视图不再在任何浏览器中渲染。IE7/8兼容性的方式有改变吗?我使用的是CDN的1.0.2版
谢谢。编辑说明:添加doctype标签将减少一些问题。
谢谢@Mike Pateras
<!doctype html>
原件:
试试这个
<html lang="en" class="ng-app:myapp" id="ng-app" ng-app="myapp" xmlns:ng="http://angularjs.org">
<head>
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!--[if lte IE 8]>
<script>
document.createElement('ng-include');
document.createElement('ng-pluralize');
document.createElement('ng-view');
document.createElement('ng:include');
document.createElement('ng:pluralize');
document.createElement('ng:view');
</script>
<![endif]-->
<!--[if lt IE 8]>
<script src="https://cdnjs.cloudflare.com/ajax/libs/json2/20150503/json2.min.js"></script>
<![endif]-->
</head>
这在本地修复了所有浏览器中的视图问题,但当我使用IE从另一台机器指向服务器时(Chrome远程工作正常),我的视图显示为空。此外,IE的所有版本都有奇怪的行为,当我尝试检查元素时,它们上面有这些“jQuery1800492917332865918=3”属性。这对IE正常吗?不,对我来说很好。我在服务器上部署了上述代码,效果很好。我的意思是,至少在功能上,它工作得很好,你仍然需要修复CSSMI,我的最佳猜测是你的IE保留了缓存。你不能只是点击开发工具上的清除缓存。但这并不是每次都有效。这件事曾经发生在我身上,明白了。添加使它停止默认为怪癖模式,这是我大部分问题的原因,然后我只需要修复一些在好的浏览器中没有问题的随机错误。感谢您的帮助。json2.js缺少CDN路径添加class=“ng app”为我修复了IE8,谢谢!