我正在开发对API的AJAX HTTP-POST请求,但是在Mozilla Firefox上总是会出现以下错误:
由于MIME类型不匹配(“ text / html”)(X-Content-Type-Options:nosniff),资源“ https://script.google.com/macros/s/AKfycbwmqG55tt2d2FcT_WQ3WjCSKmtyFpkOcdprSITn45-4UgVJnzp9/exec?url=http://librairy.linkeddata.es/ods-model/classes&callback=jQuery31109831060291564537_1560774264336&text=aaaaaaaaaaaa&_=1560774264337”被阻止。
$(document).on('submit', '#sendtext_form', function(e) {
e.preventDefault();
var text1 = $('#textForm').val();
var text = text1.replace(/["']/g, "\\'");
$.ajax({
url:'http://librairy.linkeddata.es/ods-model/classes',
method: "POST",
contentType: "application/json",
data: {
"text": text,
},
success: function(result_api) {
console.log(result_api);
}
})
});