Answer the question
In order to leave comments, you need to log in
What is wrong with AJAX request?
When executing the request, it gives an error, what is the reason?
XMLHttpRequest cannot load www.openrates.in.ua/rates . No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin ' test ' is therefore not allowed access.
$.ajax({
type: 'GET',
url: "http://www.openrates.in.ua/rates",
dataType: 'json',
cache: false,
success: function(data) {
console.log(data);
}
});
Answer the question
In order to leave comments, you need to log in
deal with promises. Do not go over quickly, but experiment for a couple of hours and read the documentation.
It is written in English and white - the responding resource does not issue the Access-Control-Allow-Origin header, which is why the response from it is filtered and not passed to the script.
And if in a simple way: the resource does not allow the collection of information
Add to the .htaccess of the donor site:
<IfModule mod_headers.c>
Header add Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"
Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"
</IfModule>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question