Angular JS不使用IE9,但可以与其他浏览器一起使用

Ton*_*oni 3 html javascript jquery internet-explorer angularjs

所以我正在开发一个小型应用程序,它可以从API网址获取,如此... $ http.get(s_url).then(function(res){...我的应用程序适用于chrome,safari,opera和firefox但在IE9中显示一个空白屏我错过了我的html或js文件中的内容吗?这就是我在IE的html文件中所拥有的...

    <!--[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>
Run Code Online (Sandbox Code Playgroud)

小智 8

尝试使用数据为ng-app和ng-view添加数据,如data-ng-app,data-ng-view.

  • 谢谢.我把它添加到我的代码中.主要问题是http.get方法与IE有一些问题所以我不得不使用XMLHttpRequest(). (2认同)