jquery $(多选择器).each()不是一个函数firefox [英] jquery $(multi selector).each() not a function firefox
本文介绍了jquery $(多选择器).each()不是一个函数firefox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$(document).ready(function(){$ b $ (window.setInterval()函数(){
$(#customers,td,#span)。each(function(){
if($(this).children(span)。 attr(alt)!= null)
var dt = new Date($(this).children(span)。attr(alt)。split(,)[3])。 getTime();
if(dt> $。now() - 10 * 1000){//我在这里??
console.log(animating);
$( ()); $ b $(this).parent()。fadeIn(slow);
}
});
},1000);
});
这段代码可以在chrome上正常工作,但是在firefox上不起作用。
firefox说 TypeError:$(...)。每个都不是一个函数
。
Can任何一个帮助我?
解决方案
它看起来像 new Date()
日期是;
新日期(2013-04-07 15:39:17);
我将其更新为;
<$ p $新的日期(2013/04/07 15:39:17);
I am having the code below in page;
$(document).ready(function() {
window.setInterval(function(){
$("#customers, td, #span").each(function(){
if($(this).children("span").attr("alt")!=null)
var dt=new Date($(this).children("span").attr("alt").split(",")[3]).getTime();
if(dt>$.now()-10*1000){ //am i right here??
console.log("animating");
$(this).parent().fadeOut("slow");
$(this).parent().fadeIn("slow");
}
});
},1000);
});
this code works fine on chrome, but does not work on firefox;
firefox saying TypeError: $(...).each is not a function
.
Can any one help me??
解决方案
it looks like new Date()
is not working in firefox.
the date was;
new Date("2013-04-07 15:39:17");
i updated it to;
new Date("2013/04/07 15:39:17");
这篇关于jquery $(多选择器).each()不是一个函数firefox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文