【问题标题】:Way Failed to load resource: the server responded with a status of 404 not found?加载资源失败:服务器响应状态为 404 未找到?
【发布时间】:2017-04-23 07:13:35
【问题描述】:

这是我的代码: 问题角度加载资源失败:服务器响应状态为 404(未找到)

app.controller("allFarmerCtrl",function($scope,$http){

  $scope.perPage = "50";
  $scope.allFarmers = [];
  $scope.reverse = false;

  var where = {
    table : "farmer"
  };


  $http({
    method : "POST",
    url : url + "read",
    data : where
  }).success(function(response){
    if(response.length>0){
      angular.forEach(response,function(values , index){
         values['sl'] = index+1;
         $scope.allFarmers.push(values);
      });     
    }else{
      $scope.allFarmers = [];
    }

    console.log($scope.allFarmers);
  });
});

【问题讨论】:

  • 您的网址可能不正确。交叉检查您的网址、请求方法类型。如果这可行,也试试url : url + "read"

标签: angularjs


【解决方案1】:

如果您使用的是实时服务器扩展,您可以通过在浏览器中创建的 url 后添加 / 来解决此问题。 例如你可以将index.html修改为index.html/

【讨论】:

    猜你喜欢
    • 2015-12-01
    • 2018-08-09
    相关资源
    最近更新 更多