Cross-Origin Request Blocked

matchaking ca Canada

I'm trying to make a request using Jquery and keep getting the Cross-origin block. I am wondering if this is a problem on my end or if lingq server is denying me access to API.

Error message is at the bottom, any help is much appreciated.

var settings = {

"async": true,

"crossDomain": true,

"url": "https://www.lingq.com/api/languages/en/lessons/108135/text/",

"method": "GET",

"headers": {

"authorization": "Token MY_API_KEY",

"cache-control": "no-cache",

},

"Access-Control-Allow-Origin": "*"

}

$(document).ready(function() {

$.ajax(settings).done(function (response) {

console.log(response);

});

});

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at

December 19 at 20:42
  • matchaking ca Canada

    my solution was to stop making the request through chrome and instead make it through node js. you could also use postman or whatever lang you want

    February 13 at 06:49
  • ericb100 us United States

    This thread might help:

    Try jsonp, but that still may not work if CORS isn't enabled on Lingq...then I'd do what matchaking suggests.

    February 13 at 13:48