浏览器的同源策略及跨域请求
具有相同协议,域名和端口的页面,则具有相同的源,即它们是来自同一个服务的资源.
如,对"http://store.company.com/dir/page.html" 进行
同源检测:
URL | 结果 | 原因 |
http://store.company.com/dir2/other.html | 成功 | |
http://store.company.com/dir/inner/another.html | 成功 | |
https://store.company.com/secure.html | 失败 |