Ajax - Asynchronous request problem
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.
精彩评论