我正在打电话到四方OAuth网址。浏览器控制台打印以下错误
XMLHttpRequest cannot load https://foursquare.com/oauth2/authenticate?client_id=DF4I1TGNVHAM40PDLOHZQZ…onse_type=code&redirect_uri=http://localhost:9000/auth/foursquare/callback. No 'Access-Control-Allow-Origin' header is present on the requested resource. O
我正在玩PHP,使用ajax发送请求到0.0.0.0/ajax.php,但是实际的url现在是localhost,所以由于相同的原点策略,结果出现了一个javascript错误。The ajax.php header("Access-Control-Allow-Origin: *");
// below is some code hand
由于我使用Ajax获取数据,所以我在我的web服务器提供的动态内容中添加了一个Access-Control-Allow-Origin头。效果很好。每当我在导航栏中使用指向其中一个页面的链接时,我就会得到一个Origin null is not allowed by Access-Control-Allow-Origin.错误。