首页 > Firefox 从 setInterval 里查找 jQuery 的方法为 undefined, Chrome 却正常?

Firefox 从 setInterval 里查找 jQuery 的方法为 undefined, Chrome 却正常?

下面的代码... 写了两份:

test = ->
  console.log (typeof $.ajax)
  console.log (typeof $('body').find)

ttest = setInterval test, 1000
test = function() {
  console.log(typeof $.ajax);
  return console.log(typeof $('body').find);
};

ttest = setInterval(test, 1000);

Firefox 下持续输出 undefined, Chrome 下持续输出 function, 这是为什么?

【热门文章】
【热门文章】