Microsoft Edge不处理AJAX响应数据

时间:2017-01-18 14:19:55

标签: javascript angularjs ajax cross-browser microsoft-edge

奇怪的问题:

this page适用于除Microsoft Edge以外的所有浏览器,后者无法将从AJAX请求获取的数据显示到http://webapi.bstartup.com/api_exhibitors/3203

如果我减少了返回的json数量,那么它可以工作,但即使返回了相当大量的json(7Kb左右),也不会触发ajax请求的成功函数。

查看边缘调试器,返回数据IS(因为"请求主体"的大小是正确的,但是在我有超时期限之后触发了ajax请求的错误功能设置为10秒。

以下是我认为非常标准的ajax请求,并且在其他浏览器中运行良好:

$scope.getWebApi('api_blogs/single/'+$scope.blog_id).success(function(data) {
  $scope.blog = data
  document.title = $scope.blog.blog_title
  $scope.blog.blog_content = $scope.blog.blog_content.replace(/\r\n/g,"</br>")
}).error(function() {
    console.log("error")
})

getWebApi是一个简单的包装器:

NaidexApp.factory('getWebApi', function($http) {
  return {
    getWebApi: function(webApiParams,data) {
      console.log("getwebapi")
      return $http.post('http://webapi.bstartup.com/'+webApiParams,data, {timeout: 10000});
    }
  }
});

所以我不知道为什么没有显示响应以及为什么会触发错误回调

0 个答案:

没有答案