What is a cross-domain
When two domains have the same protocol (such as HTTP), the same port (for example, 80), the same host (for example, www.google.com), then we can assume that they are the same domain (protocol, domain name, port must be the same).
Cross-domain refers to the protocol, domain names, port inconsistencies, for security reasons, cross-domain resources are not interactive (such as the general situation of cross-domain JavaScript can not interact, of course, there are many solutions for cross-domain)
Access-control-allow-origin
Access-control-allow-origin is a policy defined in HTML5 that addresses the cross-domain of resources.
He is returning the response header with the Access-control-allow-origin identity through the server to resolve cross-domain permissions issues for the resource.
Using the method, add Access-control-allow-origin in response, for example
Access-control-allow-origin:www.google.com
Www.google.com is the domain name to access, set according to the actual situation.
can also be set to * indicates that the resource can be used by anyone
Access-control-allow-origin: *
If the resource is an HTML page, you can set the
<meta http-equiv= "Access-control-allow-origin" content= "*" >
Using Access-control-allow-origin to troubleshoot cross-domain