【发布时间】:2016-12-28 11:55:41
【问题描述】:
我在 chrome 和 firefox 中面临跨域问题,在 IE 中运行良好。我也尝试过$http.jsonp(),但仍然面临同样的问题。
JS
app.controller('myCtrl', function($scope,$http,$compile){
var serverName = "home.mcafee.com/";
var apiRequest = "http://infraapi.int.mcafee.com/api/DBData/";
$scope.ajaxCall = function(){
$http.get(apiRequest+serverName)
.success(function(data){
$scope.Detail = data;
}).error(function (data, status, headers, config){
console.log(data);
});
}
});
【问题讨论】:
-
所以基本上你的问题是在 chrome 和 firefox 中,并且在 IE 中工作得很好?如果是这样,请详细说明问题。哪个部分不工作以及采取什么措施?
-
$http.get() 请求在 IE 中可以正常工作,但在 chrome 和 FF 中则不行。
标签: javascript angularjs google-chrome firefox