angularjs – angular.js chrome Access-Control-Allow-Origin
发布时间:2020-12-17 07:24:54 所属栏目:安全 来源:网络整理
导读:我正在尝试使用Angular.js服务从Jersey / Spring的REST服务中获取 JSON. 当我使用Firefox时,它工作正常,但当我去Chrome时我收到了消息: XMLHttpRequest cannot load http://localhost:8080/VirtualLawyerPj/services/timeoftheday/asjson/tue. Origin http:
我正在尝试使用Angular.js服务从Jersey /
Spring的REST服务中获取
JSON.
当我使用Firefox时,它工作正常,但当我去Chrome时我收到了消息: XMLHttpRequest cannot load http://localhost:8080/VirtualLawyerPj/services/timeoftheday/asjson/tue. Origin http://localhost:8090 is not allowed by Access-Control-Allow-Origin. 这是我的服务代码: angular.module('myAppServices',['ngResource']). factory('Time',function($resource){ return $resource('http://localhost:port/VirtualLawyerPj/services/timeoftheday/asjson/tue',{port:":8080"},{ query: {method:'GET',params:{},isArray:false} }); }); 有人有同样的问题吗? 谢谢.
CORS解决方案在
html5rocks教程中描述.为我工作.
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |