Angular JS 不适用于 IE9,但适用于其他浏览器 [英] Angular JS not working with IE9 but works with other browsers

查看:34
本文介绍了Angular JS 不适用于 IE9,但适用于其他浏览器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我正在开发一个小应用程序,它可以从这样的 API url 中获取...$http.get(s_url).then(function(res) {...我的应用程序适用于 chrome、safari、opera 和 firefox,但在 IE9 中显示空白屏幕我的 html 或 js 文件中是否缺少某些内容?这是我在 IE 的 html 文件中的内容...

So I am working on a small app that gets that from an API url like so... $http.get(s_url) .then(function(res) {... My app works well with chrome,safari,opera and firefox but displays a blank screen in IE9 Am I missing something in my html or js file? Here is what I have in my html file for IE...

    <!--[if lte IE 8]>
    <script src="js/json2.js"></script>
    <script>
        document.createElement('ng-include');
        document.createElement('ng-pluralize');
        document.createElement('ng-view');
        document.createElement('x-restrict');
        document.createElement('x-fileupload');
        // Optionally these for CSS
        document.createElement('ng:include');
        document.createElement('ng:pluralize');
        document.createElement('ng:view');
        //customized tags
        document.createElement('location');
        document.createElement('temp');
        document.createElement('image');
        document.createElement('caption');
        document.createElement('temps');
        document.createElement('remtemps');
    </script>
    <![endif]-->
    <div ng-view></div>
</head>

推荐答案

尝试在 ng-app 和 ng-view 前面加上 data-ng-app, data-ng-view 的前缀.

Try prefixing ng-app and ng-view with data as in data-ng-app, data-ng-view.

这篇关于Angular JS 不适用于 IE9,但适用于其他浏览器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆