What is a cross-domain issue?

If I asked a stupid question here, please do not laugh at me.

I have heard Cross Domain Issuemany times, but actually do not participate in this in the real case. So I searched it on Google. But many posts talk about The cross domain issue when make a ajax call. Not even a message was found to talk about what the cross-domain problem is and why the cross-domain is not resolved? and more the question is, if I am talking about a cross-domain problem, does this mean that I made the wrong ajax request for another domain? Any other cases can cause this problem? Thank.

The posts I read

How to send a POST request for cross-domain via JavaScript?

Heading

'No' Access-Control-Allow-Origin 'is present in the requested resource "

+1
source share
2 answers

This is a security constraint that prevents requests from one source to another.

For example, this will prevent the page from getting https://to the address http://because the protocol is different.

It will stop the example.comcall another.combecause it is a different domain.

It will stop the www.example.comcall subdomain.example.combecause it is a different subdomain.

And he will stop the example.com:80call example.com:8080because it is a different port.

- JSONP ( !), CORS ( Cross-Origin), , ( ).

+8

1. : , , - . , javascript .

2. . , jsonp.

jsonp: Jsonp


+1

Source: https://habr.com/ru/post/1676450/


All Articles