微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

为什么不允许跨域AJAX通话?

除了 JSONP,为什么要遵循相同的域策略?
出于安全考虑,实行同源政策;引用相关句子从 wikipedia

This mechanism bears a particular
significance for modern web
applications that extensively depend
on HTTP cookies to maintain
authenticated user sessions,as
servers act based on the HTTP cookie
information to reveal sensitive
information or take state-changing
actions.
A strict separation
between content provided by unrelated
sites must be maintained on client
side to prevent the loss of data
confidentiality or integrity.

基本上,你不想要任何给定的网站(像任何你可能正在冲浪的网站,我们都知道人们有时到达你不应该信任的网站)能够从任何其他网站访问数据,或社交网络上的帐户).

原文地址:https://www.jb51.cc/ajax/159817.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐