jquery $(multi selector).each() not a function fir

2019-09-20 01:11发布

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??

1条回答
地球回转人心会变
2楼-- · 2019-09-20 01:58

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");
查看更多
登录 后发表回答