javascript - GET 未定义

标签 javascript php angularjs rest http

我正在使用 Angular 中的 ajax 调用来调用用 php 编写的值表单文件,代码是 ..

  var occurence = $http({
  url:'getSelectFields_api.php',
  method: GET,
  params:{"api":"TRUE",
             "functionName" : "getFields" ,
              "field_id":"occur",
             "list_id":"occurrence",
             "empty_title":"SKIP",
             "data_type":1,}

}).success(function(data){

     $scope.occurences =data;
     console.log(occurences);
     });

在控制台中我得到的是“GET 未定义……”请指导我.. 谢谢...

最佳答案

您错过了其中的字符串定义。它应该是'GET'

关于javascript - GET 未定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31938235/

相关文章:

javascript - react : Text and ternary combination not working

javascript - 如何不传递 HTML 表单中的空输入字段

php - 如何在 PHP 中使用 cURL 找到我将被重定向的位置?

javascript - 如何在不使用 jquery 的情况下使用 Angular 在 div 中添加内容

javascript - Twitter Bootstrap 2.1 模态正在删除模态主体内容

javascript - jQuery - Cloud9 轮播 - 转到功能

php - 在 Laravel5 中调用未定义的方法 Illuminate\Http\Response::json()

php - 获取双列表框中的选定值 PHP

javascript - 将参数传递给 angularjs 过滤器

javascript - 嵌套 ng-repeat 中的 Angular ng-show/ng-hide 问题