我正在使用jQuery 1.9.1,并尝试每5秒调用一次ajax查询并更新一些内容。jQuery:Uncaught TypeError:Object#<Object> has no method'apply'
使用下面的代码,我得到了Chrome的控制台以下错误:
Uncaught TypeError: Object #<Object> has no method 'apply'
线的误差是是jquery.min.js
$(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);
});
我已经第3行通过其他有同样问题的问题,但尝试修复这些问题对我的问题没有影响。
刚刚添加了这两个分号(并在这里更新了代码),但我仍然得到相同的错误。 – penguin 2013-03-09 23:15:17