如何解决跨域问题 我这样打电话给json,但在这里我得到跨域错误
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://.........json. (Reason: CORS header 'Access-Control-Allow-Origin' missing).
我的代码
app.factory('appServices', function($http){
var servicesData = {};
servicesData.homeSearch = function(){
return $http({
method: 'GET',
url : 'http://sg.media-imdb.com/suggests/t/tita.json'
}).success(function(data, status , header, config){
console.log('Success')
})
.error(function(data, status , header, config){
console.log('error')
});
}
return servicesData;
});
这里的完整代码http://codepen.io/shibinragh/pen/obxGmQ
对不起,我是开发方面的初学者,我对跨域问题知之甚少