AngularJS IE错误:SCRIPT 5009: 'JSON_XYZ'是未定义的

AngularJS IE Error: SCRIPT 5009: 'JSON_XYZ' is undefined

本文关键字:XYZ 未定义 JSON 5009 错误 AngularJS IE SCRIPT      更新时间:2023-09-26

我正在访问返回JSON的REST服务。JSON响应的格式为JQUERY_1234 ({ABC:[]})。使用angularJS和IE9作为浏览器,我得到一个错误,说SCRIPT 5009: 'JQUERY_1234'是未定义的。我是angular JS的新手,希望能在我出错的地方得到一些指导。相同的代码适用于另一个URL,但在这个URL上失败。谢谢你的帮助!

我的控制器代码是:
var myNameSpace=angular.module('myApp',[]);
myNameSpace.controller('MyController',function MyController($scope,$http){
$http.jsonp('URL').success(function(data) {
$scope.artists = data;
})
.error(function (data, status, headers, config) {
alert("error:" + status);
return status;
});
    $scope.orderAlerts='Name';
});     

用于JSON的URL字符串需要有参数callback="JSON_CALLBACK"。它是http.jsonp

的必选参数。