答案 0 :(得分:1)
使用JSONP“hack”,您必须确保服务器的响应包含回调的调用。要使您的示例正常工作,您应该更改prov.json文件,使其如下所示:
angular.callbacks._0({
"id": "40796308305",
"about": "The Coca-Cola Facebook Page is a collection of your stories showing how people from around the world have helped make Coke into what it is today.",
...
})
JSONP有很多来源,例如:What is JSONP all about?
答案 1 :(得分:0)
使用get代替jsonp,您可以获得可口可乐的详细信息......
async: function(page) {
var url = 'prov.json';
var promise = $http.get(url).error(function (response, status) {
alert("fai");
}).success(function (response, status) {
alert(response.about);
}).then(function (response, status) {
return response.data;
});
return promise;
}};