AngularJS Hello World in IE11



下面的代码在Safari和Chrome中可以正常工作,但在IE11中不行。有人能帮忙吗?

<!DOCTYPE html>
<html xmlns:ng="http://angularjs.org">
<head>
    <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.js"></script>
</head>
<body ng-app ng-init="name = 'World'">
    <h1>Hello, {{name}}!</h1>
</body>
</html>

如果您从文件系统打开该脚本,则IE会阻止该脚本(Internet Explorer限制此网页运行脚本或activex控件)。

允许脚本内容在此站点上运行后,IE11也可以工作了。

参见http://jsfiddle.net/n8aqL/(它在通过http服务器提供服务时有效)

//Hello, World!

您可以在Internet选项->高级->设置->安全-> "允许活动内容在我的计算机上运行我的文件"中更改IE11中的本地阻止脚本

最新更新