I am trying to get data((some quotes) from forismatic api but i am not getting any response. I am using ajax in jquery, but i am getting the following error in my console:
Refused to execute script from 'https://api.forismatic.com/api/1.0/?&callback=jQuery32105928698091179365_1493889543432&method=getQuote&format=jsonp&lang=en&jsonp=?&_=1493889543433' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
I know this question has been asked already but i am not getting what should i do, i tried everything but still this error is coming. I also tried CORS but i think i am doing somewhere something wrong as i am very new to jquery so my concepts are not clear yet. Can anyone please tell me how to solve this problem, i kind of understood the problem but i don't know how to solve it. Any help will be appreciated thanku!
This is my js file containing the function:
function getQuote(){
$.ajax({
url:'https://api.forismatic.com/api/1.0/?' + '&callback=?',
dataType:'jsonp',
data : 'method=getQuote&format=jsonp&lang=en&jsonp=?',
success: function(response){
$('.load').hide();
$('blockquote').show();
$('#quoteText').html(response.quoteText);
if(response.quoteAuthor !== ''){
$('#quoteAuthor').html(response.quoteAuthor);
}
else{
$('#quoteAuhtor').html('Unknown')
}
}
});
};