浏览器/跨域:修订间差异
来自康健生活
| 第1行: | 第1行: | ||
== 引言 == | == 引言 == | ||
跨域指浏览器禁止当前页面的所在的源去请求另一个源的数据。 | |||
{| class="wikitable" | |||
|- | |||
| 协议跨域 || <pre> | |||
http://foo.baidu.com | |||
-> | |||
https://foo.baidu.com | |||
</pre> | |||
|- | |||
| 端口跨域 || <pre> | |||
http://foo.baidu.com:80 | |||
-> | |||
http://foo.baidu.com:3000 | |||
</pre> | |||
|- | |||
| 子域名跨域 || <pre> | |||
https://foo.baidu.com | |||
-> | |||
https://bar.baidu.com | |||
</pre> | |||
|- | |||
| 域名跨域 || <pre> | |||
https://baidu.com | |||
-> | |||
https://alibaba.com | |||
</pre> | |||
|} | |||
== 同源策略 == | == 同源策略 == | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||