在SO上发现一个解释跨域很棒的,忍不住拿过来 链接在此:http://stackoverflow.com/questions/10636611/how-does-access-control-allow-origin-header-work Access-Control-Allow-Origin is a CORS (Cross-Origin Resource Sharing) header. When Site A tries to fetch content from Site B, Sit
概念:CORS是一个W3C标准,全称是"跨域资源共享"(Cross-origin resource sharing).它允许浏览器向跨源服务器,发出XMLHttpRequest请求,从而克服了AJAX只能同源使用的限制. 现象:如请求出现:Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the re