There is the following code:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script> $.ajax({ url: "http://vm1.culture.ru/abramtsevo/catalog/ajax.php", data: { YEAR_SEARCH_LEFT: "-99", YEAR_SEARCH_RIGHT: "1999", TEGS: "Предметы быта" }, type: 'POST', crossDomain: true, success: function() { alert("Success"); }, }); </script> 

How can you avoid the unfortunate error "No Access-Control-Allow-Origin"?

And the question is that there is no complete duplication: how does the https://cors-anywhere.herokuapp.com/ mechanism (if added before the link in the "url" so that it is " https://cors-anywhere.herokuapp.com/http : //vm1.culture.ru/abramtsevo/catalog/ajax.php ", everything works) does it all bypass?

The same project on github: https://github.com/Rob--W/cors-anywhere

  • No, the same-origin policy will not allow. - Sergey Gornostaev
  • 3
    Possible duplicate question: XMLHttpRequest cannot load. No 'Access-Control-Allow-Origin' header - Sergey Gornostaev
  • Dubbing: stackoverflow.com/questions/435319/… . Look carefully for a search. But in general - Sergey answered everything correctly - read about cross-domain queries. - alexoander
  • Updated the question. - Timur Musharapov
  • one
    cors-anywhere is a proxy server that forwards requests to the right servers and adds an Access-Control-Allow-Origin header to the responses. If you have your own server, you can easily raise it there. By the way, an explanation of this is in the answer to the question that you duplicate. - Sergey Gornostaev

0