And what is the general problem with this code? Does not work

srcs = [ "upload/iphone.png", "upload/screen.png" ] ### setInterval( function() { $('.image1').fadeOut(300, function() { $(this).attr('src',srcs[Math.floor(Math.random()*srcs.length)];).bind('onreadystatechange load', function() { if (this.complete) $(this).fadeIn(300); }); }); }), 5000); 

Closed due to the fact that off-topic participants Dmitriy Simushev , Alexey Shimansky , aleksandr barakin , Pavel Mayorov , VenZell 23 May '16 at 11:47 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - Dmitriy Simushev, Alexey Shimansky, Pavel Mayorov, VenZell
If the question can be reformulated according to the rules set out in the certificate , edit it .

    1 answer 1

    Math.floor(Math.random()*srcs.length)]; remove ;
    }), 5000); - remove the first brackets )

    Is your editor not highlighting errors? I just do not quite understand what the difficulty arose to find an error?