I try to get information from an online dictionary api. I've sent too many queries, so they blocked me. That's not the problem, I'm just trying to handle this and notify the user that he/she got blocked because of too many queries.
But here's the problem: though I see a json file in the browser when I try to use the api directly, I can't get the same message using jQuery on my website's client side. Here's the code:
function getMeaningList(expression) {
$.ajax({
url: "http://glosbe.com/gapi/translate?from=eng&dest=hun&format=json&phrase=" + expression,
dataType: "jsonp",
success: function (data) {
alert("SUCCESS!!!");
sendJsonToServerForParsing(expression,data);
},
error: function (xhr, status, error) {
console.log('sendJsonToServer error');
alert('sendJsonToServer error');
}
});
}
When I test this part of the code, I don't see either the success or the error alerts. The function itself runs through.
If I check it in firebug, I see the following:
I'd like to add that the same code works when I'm not blocked. What happens here? (why is it that neither of the two callbacks gets called?)