The following error is given when I try to request coursera api with jsonp method in Angular.
Refused to execute script from 'https://api.coursera.org/api/courses.v1?callback=angular.callbacks._0' because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled.
I have gone through the other answers but could not find the correct solution.
This is my code which I think is done correctly as it fetches other CORS resources successfully. I dont know whats going on with coursera api.
var deferred = $q.defer();
var url = "https://api.coursera.org/api/courses.v1?callback=JSON_CALLBACK";
$http.jsonp(url).success(function(data) {
deferred.resolve(data);
})
.error(function(data, status, headers, config) {
deferred.reject(status);
});
return deferred.promise;