H
H
Hakhagmon2016-02-03 16:37:45
JavaScript
Hakhagmon, 2016-02-03 16:37:45

What is wrong with ajax request using jsonp?

Script code:

$.ajax({
url: "https://api.spotify.com/v1/albums/7qJGcO7e7qVNPi4grufK8B",
dataType: "jsonp",
jsonp: "callback",
type: "GET",
contentType: "application/json; charset=utf-8",
success:function(response){
alert(1);
}
});

The error that is displayed in the request:
Refused to execute script from ' https://api.spotify.com/v1/albums/7qJGcO7e7qVNPi4g... ' because its MIME type ('application/json') is not executable, and strict MIME type checking is enabled.

Please tell me how to submit a request.
0988977bffd44bf8b03ac8e4ad8d4a15.pngCS1X5USyY4A.jpg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Kustikov, 2016-02-11
@Hakhagmon

This particular error can only be resolved on the server side.
+ Judging by the official JSONP documentation, they do not support.
There remains the option of working through a server proxy: https://github.com/spotify/web-api-auth-examples

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question