Why CORS to sites not working with your browser?

Why browser CORS is not working and says the error "Failed to load https://yandex.ru/: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access."

And if you make a request from the local server t oats normal?
June 8th 19 at 17:02
2 answers
June 8th 19 at 17:04
ochevidno the cheder they prescribed localhost, and the website from which you are trying to make a request - no
I understand it is impossible to bypass?)) - Loyce_Mil commented on June 8th 19 at 17:07
well depends what you want, maybe for your purpose they have a separate endpoint with a * in the course header - hailee commented on June 8th 19 at 17:10
June 8th 19 at 17:06
Recently faced with this problem, didn't understand why origin is null. I sent requests with Chrome on localhost. It turns out Chrome special policy of dealing with ajax requests in the local directory. A site I discovered primitive, just in a folder by selecting file index.html. So I had to deploy a local web server and it fill the website. And then everything began to work, origin was to be set to the address from which the request is sent.
You may find this helpful.

Find more questions by tags JavaScriptCORS