Answer the question
In order to leave comments, you need to log in
Why is an AJAX request not coming to a third-party site?
I can't figure out why the ajax request doesn't go through on a third party site. Although I prescribe the heading "Access-Control-Allow-Origin: *".
var XHR = ("onload" in new XMLHttpRequest()) ? XMLHttpRequest : XDomainRequest;
var xhr = new XHR();
xhr.open('CORS', 'http://data.teletrade-dj.com/api/quotes/current?authkey=DdQJTOdb9fjI&terms=EURUSD,GBPUSD,USDCAD,GOLD,USDRUR', true);
xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
xhr.onload = function() {
console.log( this.responseText );
}
xhr.onerror = function() {
}
xhr.send();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question