首页 > 代码库 > No 'Access-Control-Allow-Origin' header is present on the requested resource.

No 'Access-Control-Allow-Origin' header is present on the requested resource.

/*********************************************************************** * No ‘Access-Control-Allow-Origin‘ header is present on the requested resource.  * 说明: *     之前没考虑到Ajax跨域访问会遇到这个问题,今天梦真在测试的时候看到 * 这个现象,于是查找资料看一下怎么解决。 * *                                     2016-10-12 深圳 南山平山村 曾剑锋 **********************************************************************/一、参考文档:    js跨域访问,No ‘Access-Control-Allow-Origin‘ header is present on        http://zjblogs.com/js/Access-Control-Allow-Origin.html二、解决办法:    如果请求的url是PHP页面,则需要在PHP页面中添加代码:header("Access-Control-Allow-Origin: *");

 

No 'Access-Control-Allow-Origin' header is present on the requested resource.