How to resolve CORS ie same origin policy in angularjs -


i developing mobile application in angularjs have make call web service. but, when making call $http.get giving following error.

xmlhttprequest cannot load http://example.com/first_step.json. no 'access-control-allow-origin' header present on requested resource. origin 'http://127.0.0.1:8020' therefore not allowed access.  

my function follows:

$scope.firststepclick = function() {     appsvc.selecteditem = "firststep";     $rootscope.go('parent/firststep', 'slideleft');     delete $http.defaults.headers.common['x-requested-with'];                 $http.get("http://example.com/first_step.json").success(function(data) {         $scope.firststepdata = data;     }).error(function() {         alert("an unexpected error occured");     }); }; 

so, please me solve cors problem. using html5, css3 , angularjs mobile app development.

thanks in advance

you don't have in angular side.

the server side 1 responsible send rights headers enable cors

take this:

http://enable-cors.org/server.html


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -