Ich habe diese API http://api.program-o.com/v2/chatbot/?bot_id=6&say=what%20is%20your%20name&convo_id=exampleusage_1231232&format=xml, die ich mit dem Browser aufrufen, dann bekomme ich richtige Antwort. Aber wenn ich Jquery Ajax-Aufruf verwenden, dann bin ich der Fehler immerWie man einen jsonp mit jquery aufruft?
*Refused to execute script from 'http://api.program-o.com/v2/chatbot/?bot_id=6&say=what%20is%20your%20name&c…ormat=xml&callback=?%20&callback=jQuery172005527849208121283_1460880216789' because its MIME type ('text/xml') is not executable, and strict MIME type checking is enabled.*
Code ist wie unten
<!DOCTYPE html>
<html lang="en">
<head>
<title>JQuery (cross-domain) JSONP Twitter example</title>
<script type="text/javascript"src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script>
$.ajax({
url: "http://api.program-o.com/v2/chatbot/?bot_id=6&say=what%20is%20your%20name&convo_id=exampleusage_1231232&format=xml&callback=? ",
type: "GET",
dataType: 'jsonp',
cache: true,
success: function (data, status, error) {
console.log('success', data);
},
error: function (data, status, error) {
console.log('error', data, status, error);
}
});
</script>
</head>
<body>
<ul id="gists"></ul>
</body>
</html>
Kann jemand mir bitte sagen, warum ich falsch mache?
Ich bekomme den gleichen Fehler – SpringLearner