admin管理员组文章数量:1312836
I have problems getting my app loading on Internet Explorer 7 & 8 and even 9.
I'm getting the following error message (console)
Uncaught TypeError: Cannot read property 'nodeName' of undefined
On load the {{}} variables are loading and disappearing. Nothing has been rendered.
I added this to the html tag:
<html xmlns="" xmlns:fb="" xmlns:ng="" id="ng-app" class="ng-app: myapp;">
I added ieshiv.js from the AngularUI framework.
I added
<!--[if lt IE 8]>
<script src="files/js/json3.min.js"></script>
<![endif]-->
(Question: is this enough, just adding to my head section or must I modify my code too?)
I also added this to my head section:
<!--[if lte IE 8]>
<script>
document.createElement('ng-include');
document.createElement('ng-pluralize');
document.createElement('ng-view');
document.createElement('slide');
document.createElement('carousel');
// Optionally these for CSS
document.createElement('ng:include');
document.createElement('ng:pluralize');
document.createElement('ng:view');
</script>
<![endif]-->
And it doesn't work at all. No variables are loaded, not list is rendered and the website isn't working.
Chrome, FF and Opera are working fine.
Do you have any hints where to start ?
EDIT 1:
Link to my controller.js on paste.bin
EDIT 2:
Is it maybe the order of the js loading?
<script src=".7.1/jquery.min.js"></script>
<script src=".8.18/jquery-ui.min.js"></script>
<!--[if lt IE 8]>
<script src="files/js/json3.min.js"></script>
<![endif]-->
<script src="files/js/angular.min.js"></script>
<script src="files/js/ui-bootstrap-tpls-0.1.0-SNAPSHOT.js"></script>
<script src="files/js/angular-ui.js"></script>
<script src="files/js/angular-resource.min.js"></script>
<script src="files/js/controller.js"></script>
<script src="files/js/select2.js"></script>
<script src="files/js/main.js"></script>
EDIT 3:
Ok, I added fauxconsole.js to my script and cleaned the code and it worked. Well, at least it is loading properly (without any css correction). But it doesn't load inline style on some of my tags. Do you have an idea why?
<a ng-click="details.show=toggle(marker)" ng-class="{active_marker: active_marker.show == marker.id}" href="#/dealer/{{marker.id}}" class="marker" style="left:{{marker.coordleft}}px;top:{{marker.coordtop}}px">
</a></div>
EDIT 4:
Edit 3 is also solved with this help here:
But I got now an other problem. In IE 8 and below the route template aren't rendering. I just see the {{}} variables and not more.
EDIT 5:
That is strange. I managed to load the first template right. All brackets {{}} are loading properly.
I added .resolve to my Ctrl:
// DealerDetailsCtrl
function DealerDetailsCtrl($scope, $rootScope, $routeParams, dealerService, datasets) {
$scope.loading = true;
// Abfrage
$rootScope.dealerdetails = datasets;
// inline styles fuer positionierung laden
$rootScope.itemStyle2 = function (item) {
return { left: item.divleft * 1 + 390 + 'px', top: item.divtop * 1 + 160 + 'px'};
};
//Feedback zur Message zurruecksetzen
$scope.issend = $rootScope.issend;
$rootScope.issend = false;
$scope.loading = false;
//Close Button
$rootScope.close = function() {
$rootScope.marker = null;
$rootScope.details = {show: false};
$rootScope.alldealer = {show: false};
$rootScope.active_marker = null;
};
$rootScope.$on("$routeChangeStart", function (event, next, current) {
$scope.loading = true;
});
}
DealerDetailsCtrl.resolve = {
datasets : function($q, $http, $route, $rootScope) {
var deferred = $q.defer();
$http.get('files/framework/dealer/'+ $route.current.params.id +'/' + $rootScope.token).success(function(data) {
deferred.resolve(data);
});
return deferred.promise;
}
};
The strange thing is. From the (correctly rendered) template, I link to a second template and route (from dealer/:id to /dealermessage/:id), but THIS route (and everything is the same including the resolve) isn't loading properly, same error than before, the template isn't rendered.
Routes:
app.config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/dealer/:id', {
templateUrl: 'files/tpl/dealer-details.html?333',
controller: 'DealerDetailsCtrl',
activetab: 'details',
resolve: DealerDetailsCtrl.resolve
}).
when('/dealermessage/:id', {
templateUrl: 'files/tpl/dealer-message.html?222',
controller: 'DealerMessageCtrl',
activetab: 'message',
resolve: DealerMessageCtrl.resolve
}).
when('/dealersendmessage/:id', {
templateUrl: 'files/tpl/dealer-details.html?444',
controller: 'DealerDetailsCtrl',
activetab: 'details',
resolve: DealerDetailsCtrl.resolve
}).
otherwise({
redirectTo: '/dealer'
});
}]);
Does anyone has a clue, what or where the mistake may be?
I have problems getting my app loading on Internet Explorer 7 & 8 and even 9.
I'm getting the following error message (console)
Uncaught TypeError: Cannot read property 'nodeName' of undefined
On load the {{}} variables are loading and disappearing. Nothing has been rendered.
I added this to the html tag:
<html xmlns="http://www.w3/1999/xhtml" xmlns:fb="http://www.facebook./2008/fbml" xmlns:ng="http://angularjs" id="ng-app" class="ng-app: myapp;">
I added ieshiv.js from the AngularUI framework.
I added
<!--[if lt IE 8]>
<script src="files/js/json3.min.js"></script>
<![endif]-->
(Question: is this enough, just adding to my head section or must I modify my code too?)
I also added this to my head section:
<!--[if lte IE 8]>
<script>
document.createElement('ng-include');
document.createElement('ng-pluralize');
document.createElement('ng-view');
document.createElement('slide');
document.createElement('carousel');
// Optionally these for CSS
document.createElement('ng:include');
document.createElement('ng:pluralize');
document.createElement('ng:view');
</script>
<![endif]-->
And it doesn't work at all. No variables are loaded, not list is rendered and the website isn't working.
Chrome, FF and Opera are working fine.
Do you have any hints where to start ?
EDIT 1:
Link to my controller.js on paste.bin
http://pastebin./z67qE9ME
EDIT 2:
Is it maybe the order of the js loading?
<script src="https://ajax.googleapis./ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="https://ajax.googleapis./ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"></script>
<!--[if lt IE 8]>
<script src="files/js/json3.min.js"></script>
<![endif]-->
<script src="files/js/angular.min.js"></script>
<script src="files/js/ui-bootstrap-tpls-0.1.0-SNAPSHOT.js"></script>
<script src="files/js/angular-ui.js"></script>
<script src="files/js/angular-resource.min.js"></script>
<script src="files/js/controller.js"></script>
<script src="files/js/select2.js"></script>
<script src="files/js/main.js"></script>
EDIT 3:
Ok, I added fauxconsole.js to my script and cleaned the code and it worked. Well, at least it is loading properly (without any css correction). But it doesn't load inline style on some of my tags. Do you have an idea why?
<a ng-click="details.show=toggle(marker)" ng-class="{active_marker: active_marker.show == marker.id}" href="#/dealer/{{marker.id}}" class="marker" style="left:{{marker.coordleft}}px;top:{{marker.coordtop}}px">
</a></div>
EDIT 4:
Edit 3 is also solved with this help here:
https://groups.google./d/msg/angular/0zHsVuUryKI/ckTvY93NcRsJ
But I got now an other problem. In IE 8 and below the route template aren't rendering. I just see the {{}} variables and not more.
EDIT 5:
That is strange. I managed to load the first template right. All brackets {{}} are loading properly.
I added .resolve to my Ctrl:
// DealerDetailsCtrl
function DealerDetailsCtrl($scope, $rootScope, $routeParams, dealerService, datasets) {
$scope.loading = true;
// Abfrage
$rootScope.dealerdetails = datasets;
// inline styles fuer positionierung laden
$rootScope.itemStyle2 = function (item) {
return { left: item.divleft * 1 + 390 + 'px', top: item.divtop * 1 + 160 + 'px'};
};
//Feedback zur Message zurruecksetzen
$scope.issend = $rootScope.issend;
$rootScope.issend = false;
$scope.loading = false;
//Close Button
$rootScope.close = function() {
$rootScope.marker = null;
$rootScope.details = {show: false};
$rootScope.alldealer = {show: false};
$rootScope.active_marker = null;
};
$rootScope.$on("$routeChangeStart", function (event, next, current) {
$scope.loading = true;
});
}
DealerDetailsCtrl.resolve = {
datasets : function($q, $http, $route, $rootScope) {
var deferred = $q.defer();
$http.get('files/framework/dealer/'+ $route.current.params.id +'/' + $rootScope.token).success(function(data) {
deferred.resolve(data);
});
return deferred.promise;
}
};
The strange thing is. From the (correctly rendered) template, I link to a second template and route (from dealer/:id to /dealermessage/:id), but THIS route (and everything is the same including the resolve) isn't loading properly, same error than before, the template isn't rendered.
Routes:
app.config(['$routeProvider', function($routeProvider) {
$routeProvider.
when('/dealer/:id', {
templateUrl: 'files/tpl/dealer-details.html?333',
controller: 'DealerDetailsCtrl',
activetab: 'details',
resolve: DealerDetailsCtrl.resolve
}).
when('/dealermessage/:id', {
templateUrl: 'files/tpl/dealer-message.html?222',
controller: 'DealerMessageCtrl',
activetab: 'message',
resolve: DealerMessageCtrl.resolve
}).
when('/dealersendmessage/:id', {
templateUrl: 'files/tpl/dealer-details.html?444',
controller: 'DealerDetailsCtrl',
activetab: 'details',
resolve: DealerDetailsCtrl.resolve
}).
otherwise({
redirectTo: '/dealer'
});
}]);
Does anyone has a clue, what or where the mistake may be?
Share Improve this question edited Jan 23, 2013 at 1:41 Marek123 asked Jan 22, 2013 at 17:40 Marek123Marek123 1,2117 gold badges39 silver badges78 bronze badges 8- Posting some code in a jsfiddle would be a great way to get started. – Patrick Commented Jan 22, 2013 at 18:09
- This may be quite a problem because it's a customer project splitted up in a lot of files but I will post my controller.js and the main html template. Just a moment. – Marek123 Commented Jan 22, 2013 at 18:10
- I've added the <script> section to my post. – Marek123 Commented Jan 22, 2013 at 18:31
- Ok, i added fauxconsole.js to my script and cleaned the code and it worked. Well, at least it is loading properly (without any css correction). But it doesn't load inline style on some of my tags. Do you have an idea why? – Marek123 Commented Jan 22, 2013 at 19:46
- 2 Can I remend that you hone this issue down (or create a new one?) with the current remaining problems? – Roy Truelove Commented May 6, 2013 at 21:16
2 Answers
Reset to default 2The project Angular-UI contains a "subproject" named "IEShiv" which should let you run angular smoothly under IE : https://github./angular-ui/angular-ui/tree/master/mon/ieshiv
As said there, you only need this :
<!--[if lte IE 8]> <script src="build/angular-ui-ieshiv.js"></script><![endif]-->
Whenever I got these type of errors in IE (specially 8) It was either one of these 2 issues.
1) I was using a custom tag like <auto-plete>
and was not using document.createElement
2) I had elements with duplicate id
attributes. IE does not like this.
Method of elimination normally works for me to isolate the problem in the template.
本文标签: javascriptAngularJS and Internet ExplorerStack Overflow
版权声明:本文标题:javascript - AngularJS and Internet Explorer - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741915853a2404726.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论