What is cross-origin? Concept: as long as the Protocol, domain name, and port are different, they are regarded as different domains. The URL indicates whether www communication is allowed. a. coma. jswww. a. comb. www. a. comlaba. jswww. a. comscriptb. different folders under the same domain name of js allow www. a .. what is cross-origin?
Concept: as long as the Protocol, domain name, and port are different, they are regarded as different domains.
URL instructions whether communication http://www.a.com/a.jshttp://www.a.com/ B .js is allowed under the same domain name allow different folders under the same domain name allow http://www.a.com/lab/a.jshttp://www.a.com/script/ B .js: 8000/. jshttp: // www.a.com/ B .js the same domain name, different ports do not allow the same http://www.a.com/a.jshttps://www.a.com/ B .js domain name, different protocols do not allow http://www.a.com/a.jshttp://70.32.92.74/ B .js domain name and domain name corresponding ip not allow the same http://www.a.com/a.jshttp://script.a.com/ B .js primary domain, different subdomains do not allow http://www.a.com/a.jshttp://a.com/ B .js of the same domain name, different second-level domain names (same as) are not allowed (cookie in this case is not allowed to access) http://www.cnblogs.com/a.jshttp://www.a.com/ B .js of different domain names are not allowed
Different ports and protocols can only be solved through the background.
Cross-origin Resource Sharing (CORS)
CORS(Cross-Origin Resource SharingCross-origin Resource Sharing defines how the browser communicates with the server when the cross-origin resource must be accessed.CORSThe basic idea behind it is to use a custom HTTP header to allow the browser to communicate with the server, so as to determine whether the request or response should succeed or fail.