-2
我剛剛得到一個基本的應用程序去,但我不能讓它在IE7 在這裏工作是HTML:Angularjs IE7問題
<!DOCTYPE html>
<html lang="en" id="ng-app" ng-app="myapp" xmlns:ng="http://angularjs.org">
<head>
<title></title>
<!-- Load Angular -->
<script src="js/angular.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<!-- Add HTML 5 Shim -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Add Json support -->
<!--[if lte IE 8]>
<script src="js/json3.js"></script>
<![endif]-->
<!-- Support these angular tags -->
<!--[if lte IE 8]>
<script>
document.createElement('ng-include');
document.createElement('ng-pluralize');
document.createElement('ng-view');
// Optionally these for CSS
document.createElement('ng:include');
document.createElement('ng:pluralize');
document.createElement('ng:view');
</script>
<![endif]-->
</head>
<body>
<!-- Template Start -->
<div ng-controller="Ctrl">
<input ng-model="name">
<h1 ng-bind="name">{{name}}</h1>
<h1>{{age - 5}}</h1>
</div>
<!-- Template End -->
<!-- Load my scripts -->
<script src="js/script.js"></script>
<!--[if lte IE 8]>
<script src="js/script2.js"></script>
<![endif]-->
</body>
</html>
這裏是JavaScript:
$(document).ready(function() {
angular.bootstrap(document);
});
var Ctrl = function($scope) {
$scope.name = "Lenny";
$scope.age = 31;
};
我我正在使用Internet Explorer 11,並將其切換到IE7以測試其工作原理。我所得到的是IE7中的大括號,但在IE8中工作正常。
您是否禁用了SCE以支持IE7?我發現這對我有用:http://stackoverflow.com/questions/21740857/angularjs-and-quirks-mode-blank-screen-on-ie8/21802157#21802157 –