jQuery:未捕获TypeError:对象#<Object>没有方法'apply'

pen*_*uin 0 javascript jquery

我正在使用jQuery 1.9.1并尝试每隔5秒调用一次ajax查询并更新一些内容.

使用下面的代码,我在Chrome的控制台中收到以下错误:

Uncaught TypeError: Object #<Object> has no method 'apply'
Run Code Online (Sandbox Code Playgroud)

错误所在的行是jquery.min.js的第3行

$(document).ready(function(){
      function getData()
      {
        $.getJSON('/ajax/pull', function(data){
          console.log(data.items);

          $("span").each(data.items, function(items){
            console.log(items);
            if($(this).attr('id') in items)
            {
                console.log('here');
            }
          });

        });
      }
      window.setInterval(function() { getData(); } , 5000);
  });
Run Code Online (Sandbox Code Playgroud)

我已经查看了其他具有相同问题的问题,但尝试这些修复对我的问题没有影响.

Mus*_*usa 5

.each()只接受一个参数,这个函数不是一个数组.