1. Shenma is a cross-domain (CrossDomain). The white point is post, and the get url is not your current website. The domain name is different. For example, in aaa.com/a.html, the table Ticket delivery action is bbb.com/ B .html. In addition, www.aaa.com and aaa.com are also cross-domain, because www... S
1. Shenma is a Cross-Domain)
The white point is that the post and get URLs are not your current website, and the domain names are different. For example, in aaa.com/a.html, the table Ticket delivery action is bbb.com/ B .html.
In addition, www.aaa.com and aaa.com are also cross-domain because www.aaa.com is a second-level domain name and aaa.com is a root domain name.
For security reasons, JavaScript does not allow cross-Origin calls to objects on other pages (Same-Origin Policy ).
For a detailed description of whether JavaScript can communicate across regions, see the following table:
Http://www.a.com/a.jsAccess the following URL results
| URL |
Description |
Allow communication? |
| Http://www.a.com/ B .js |
Under the same domain name |
Allow |
| Http://www.a.com/script/ B .js |
Different folders under the same domain name |
Allow |
| Http://www.a.com: 8000/B. js |
Different ports for the same domain name |
Not Allowed |
| Https://www.a.com/ B .js |
Different protocols for the same domain name |
Not Allowed |
| Http: // 70.32.92.74/B. js |
Corresponding ip addresses of domain names and domain names |
Not Allowed |
| Http://script.a.com/ B .js |
The primary domain is the same and the subdomain is different. |
Not Allowed |
| Http://a.com/ B .js |
Same domain name, different second-level domain names (same as above) |
Not Allowed |
| Http://www. B .com/ B .js |
Different domain names |
Not Allowed |
2. Why cross-origin?
Cross-origin is actually very common. For example, we can place some scripts, images, or other resources of a website on another site. For example, we can use jQuery provided by Google, which reduces loading time and server traffic, as shown below: