开发者

Ajax - Asynchronous request problem

开发者 https://www.devze.com 2023-01-02 19:29 出处:网络
When doing an AJAX call, why do browser security rules state th开发者_JAVA技巧at you cannot make a request to a different domain?\"[T]o prevent the loss of data confidentiality or integrity.\" See Sam

When doing an AJAX call, why do browser security rules state th开发者_JAVA技巧at you cannot make a request to a different domain?


"[T]o prevent the loss of data confidentiality or integrity." See Same Origin Policy.


For security. Learn about the Same Origin Policy.

If one webpage could make an AJAX request to another site, the browser would send along cookies to that site, and the first page could get confidential information from that site.

There are several ways to get around this restriction if (1) you are in control of both servers, or (2) you don't care about cookies. Do a Google search for cross-domain AJAX.

0

精彩评论

暂无评论...
验证码 换一张
取 消