I am using angular's $http.jsonp()
request which is successfully returning json wrapped in a function:
var url = "http://public-api.wordpress.com/rest/v1/sites/wtmpeachtest.wordpress.com/posts?callback=jsonp_callback";
$http.jsonp(url).
success(function(data, status, headers, config) {
//what do I do here?
}).
error(function(data, status, headers, config) {
$scope.error = true;
});
The problem is, I don't know how to access/parse the returned function-wrapped-JSON. Any guidance is much appreciated. Thanks!
jsonp_callback
? If not, there's your problem. – Matt Ball Aug 22 '12 at 14:24function jsonp_callback(data) { return data.found; //should be 3 }
– akronymn Aug 22 '12 at 14:32