[英]AngularJS CORS Access-Control-Allow-Origin errors
I try to access a different domain site that way: http://jsfiddle.net/carolineBda/2uZnP/ 我尝试以这种方式访问其他域站点: http : //jsfiddle.net/carolineBda/2uZnP/
I always get (error visible in the console): 我总是得到(错误在控制台中可见):
XMLHttpRequest cannot load http://www.google.fr.
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://fiddle.jshell.net' is therefore not allowed access.
I've configured the httpProvider like that: 我已经像这样配置了httpProvider:
app.config(['$httpProvider',function ($httpProvider) {
$httpProvider.defaults.useXDomain = true;
delete $httpProvider.defaults.headers.common['X-Requested-With'];
}]);
Any ideas what I'm missing? 有什么想法我想念的吗? Thanks for your help.
谢谢你的帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.