I might be missing something here but I can\'t make this JSONP request work, here is the code:
var url = \'http://\' + server + \'?callback=JSON_CALLBACK\';
@TheHippo is correct the data should not just be a plain json response. Here is a working example of a JSONP request against a youtube endpoint in AngularJS.
A couple of things to note in this example:
callback=JSON_CALLBACK
to callback=angular.callbacks._0
.alt=json-in-script
instead of alt=json
in the querystring. This was found in their documentation.I know this example is very specific but hopefully it helps!