gpt4 book ai didi

javascript - 为什么我的 angular.js 应用程序不能在 ie7 上运行?

转载 作者:可可西里 更新时间:2023-11-01 12:50:22 25 4
gpt4 key购买 nike

我创建了一个 angular.js 应用程序,它现在需要在 IE 7 及更高版本中运行。我的应用程序可以在其他浏览器上正常运行。

我一直在尝试插入 id="ng-app", xmlns:ng, boot angular manually with angular.bootstrap(document, ['myApp']), include json3.js, ...对我来说没什么用.

我正在尝试在我的 html 中插入一些数据以查看 Angular 是否正在解析我的文档,但不是......

有趣的是我的路线似乎有效(在我的应用程序中,您需要登录才能访问其他页面,如果我尝试继续 domain.ext/#/myRoute,我会被正确重定向到 domain.ext/#/)

这是我实际的 index.html({{toto}} 没有被解析,我的 ng-view 总是空白的):

<!DOCTYPE html>
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en" xmlns:ng="http://angularjs.org"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" xmlns:ng="http://angularjs.org"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>My Title</title>

<link rel="stylesheet" href="css/normalize.css" />
<link rel="stylesheet" href="css/foundation.css" />
<link rel="stylesheet" href="css/style.css" />

<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!--[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]-->
<!--<script src="js/vendor/json3.min.js"></script>-->
</head>
<body class="ng-app:myApp" id="ng-app">
<div ng-app="myApp">
<nav class="top-bar" ng-controller="MainCtrl">
{{toto}}
<!-- some html with some ng-show and ng-hide -->
</nav>

<div>
<div ng-view="ng-view"></div>
</div>

<script src="js/vendor/custom.modernizr.js"></script>
<script src="js/vendor/jquery.js"></script>
<script src="js/vendor/jquery-ui-1.10.3.custom.min.js"></script>
<script src="js/vendor/angular.js"></script>
<script src="js/vendor/angular.cookies.js"></script>
<script src="js/vendor/angular.upload.js"></script>

<script src="js/app/main.js"></script>
<script src="js/app/articles.js"></script>
<script src="js/app/medias.js"></script>
<script src="js/app/categories.js"></script>
<script src="js/app/users.js"></script>
<script src="js/app/keywords.js"></script>

<script src="js/foundation.min.js"></script>
<!--
<script src="js/foundation/foundation.js"></script>
<script src="js/foundation/foundation.alerts.js"></script>
<script src="js/foundation/foundation.clearing.js"></script>
<script src="js/foundation/foundation.cookie.js"></script>
<script src="js/foundation/foundation.dropdown.js"></script>
<script src="js/foundation/foundation.forms.js"></script>
<script src="js/foundation/foundation.joyride.js"></script>
<script src="js/foundation/foundation.magellan.js"></script>
<script src="js/foundation/foundation.orbit.js"></script>
<script src="js/foundation/foundation.placeholder.js"></script>
<script src="js/foundation/foundation.reveal.js"></script>
<script src="js/foundation/foundation.section.js"></script>
<script src="js/foundation/foundation.tooltips.js"></script>
<script src="js/foundation/foundation.topbar.js"></script>
-->
<script>
$(document).foundation();
</script>
</div>
</body>
</html>

对不起,如果我的英语这么差,

谢谢你的帮助

杰罗姆

最佳答案

此相关问题中提供的解决方案将有所帮助:

Related IE7 and AngularJS SO Question

我已经成功地将相同的方法用于 IE7,如此处所述。

关于javascript - 为什么我的 angular.js 应用程序不能在 ie7 上运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16584467/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com