Angular 1.6 - JSONP throws EXCEPTION despite Response with status: 200 Ok for URL
Im trying to grab some data from a JSONP endpoint. It looks like the data is being returned in the response but Angular nonetheless throws an error.
var url = "https://careers.icims.com/jobs-api/"
var trustedUrl = $sce.trustAsResourceUrl(url);
$http.jsonp(trustedUrl, {jsonpCallbackParam: 'jobs'}).then(function(res){
console.log(res); // this is never executed :.(
});
I am getting the following error: Uncaught ReferenceError: jobs is not defined
at jobs-api?jobs=angular.callbacks._0:1
where jobs
refers to my JSONP prefix
Yet the response returns the JSONP script:
Why is this exception being thrown and how can it be cleared? I am on Angular 1.6.0
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…