使用 JSONP 回调获取语法错误 - angularJs
Getting syxtax error using JSONP call back - angularJs
服务
some.factory('homeService', ['$http', function($http){
return {
getEvents : function(url) {
return $http.jsonp(url);
}
}
}]);
控制器
homeService.getEvents("http://server.some.io/s/first?callback=JSON_CALLBACK")
.then(
function(response){
$scope.events = response.data.events;
});
错误:未捕获的语法错误:意外的标记:
即:json对象:{"meta": {"has_next": false, "status": 200, "place":.....
错误指向 "meta"
之后
有什么线索吗?
服务器未返回 JSONP 格式。固定在服务器上。
服务
some.factory('homeService', ['$http', function($http){
return {
getEvents : function(url) {
return $http.jsonp(url);
}
}
}]);
控制器
homeService.getEvents("http://server.some.io/s/first?callback=JSON_CALLBACK")
.then(
function(response){
$scope.events = response.data.events;
});
错误:未捕获的语法错误:意外的标记:
即:json对象:{"meta": {"has_next": false, "status": 200, "place":.....
错误指向 "meta"
之后有什么线索吗?
服务器未返回 JSONP 格式。固定在服务器上。