Q:

execute callback even if jquery statement fails

I have a jquery statement as follows:
$('.panel.col2, .panel.col3').fadeOut('fast', function(){
    //SOME CODE
});

The problem is that these elements do not always exist, and I need it to execute the callback regardless of the success of the statement the callback belongs to.  Is there any workaround to this? 

A:

Try something like this:
function myCallback(){
   //SOME CODE
}

if($('.panel.col2, .panel.col3').length>0){

   $('.panel.col2, .panel.col3').fadeOut('fast', function(){
       myCallback();
   });
} else {
   myCallback();
}

