我正在使用 RequireJS 将几个(xdomain)文件从 domainB 加载到 domainA,包括 AngularJS 框架,如下所示:
var basePath = DOMAIN_B;
require.config({
baseUrl: basePath+"js/scripts/",
paths: {
'angular': '../lib/angular/angular',
'angular-route': '../lib/angular/angular-route',
'angularAMD': '../lib/requirejs/angular-amd',
'ControllerVideos': 'controller/controller-videos',
'ControllerFriendProfile': 'controller/controller-friend-profile',
'ControllerAchieve': 'controller/controller-achieve',
'ControllerDiary': 'controller/controller-diary',
'ControllerFriends': 'controller/controller-friends',
'ControllerProfile': 'controller/controller-profile',
'ControllerLanding': 'controller/controller-landing',
'ControllerMain': 'controller/controller-main'
},
// Add angular modules that does not support AMD out of the box, put it in a shim
shim: {
'angularAMD': ['angular'],
'angular-route': ['angular']
},
// kick start application
deps: ['app']
});
该行在deps:['app']
IE9 中引发“访问被拒绝”错误。这不会在 IE10、Chrome 或 FireFox 中发生。
有人知道为什么吗?