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

前端 未结 12 1499
有刺的猬
有刺的猬 2020-11-27 03:18
XMLHttpRequest cannot load http://mywebservice. No \'Access-Control-Allow-Origin\' header is present on the requested resource. Origin \'http://localhost:9000\' is t         


        
12条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-27 04:10

    Replace get with jsonp:

     $http.jsonp('http://mywebservice').success(function ( data ) {
        alert(data);
        });
    }
    

提交回复
热议问题