简体   繁体   中英

Angular JS and IE11

I'm using the Wc3 schools example of angular js, however; the given code doesn't work when I run it in IE11. It does work for Chrome.

<!DOCTYPE html>
<html>
<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<body>

<div ng-app="">
<p>My first expression from WC3S Schools: {{6+13}}</p>
</div>

</body>
</html>

Internet explorer blocks <script> tags that reference external scripts ( http://ajax.googleapis.com/... ) when you open the file from disk ( file:// ) by default.

You might get a warning that tells you something like "Executing of scripts and ActiveX-Elements is limited for this page" . (screenshot in german)

用德语截图

Either host your example.html on a server and access it via http://... or enable active content in IE. I would recommend running it from a server, since IE has other limits on file:// links (like denying AJAX requests).

When viewing HTML pages from a local resource (disk) you should allow scripts to be run when using IE. There is a yellow "popup" at the bottom of the screen, "IE restricted this webpage...." with an "allow blocked content" button. When you press this button it works

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM