我是 javascript、angularJS 和 JQuery 的新手,但我刚刚开始编写一个 angularJS 应用程序,我使用 JQuery 从这样的网络服务器获取 JSON:
var obj = $.getJSON( "http://something.com/lol?query="+ $scope.searchString, function() {
            $scope.items = obj.responseJSON.entries;                    
        }
angularJS 中是否有等于 $.getJSON 的方法?这样我就不必导入 JQuery 库。
先谢谢了,新手。
到目前为止,这是我的解决方案:
function InstantSearchController($scope, $http){
 $scope.search = function() {   
  $http.jsonp("http://something.com/lol?query="+ $scope.searchString + "?json_callback=JSON_CALLBACK").success(
                        function(data, status) {
                            console.log(data);
                        }
                );
 }
但我收到错误消息:
Uncaught SyntaxError: Unexpected token :
为什么是这样?我究竟做错了什么?}