Comunque se ti può essere utile io ho risolto così, ma non so se è molto corretto:


Codice PHP:
<script type="text/javascript">
    function 
add(){
       $(
".cat").html("immagine loading");
        $.
ajax({
            
type"POST",
            
url"http://localhost/home.php?task=addajaxcat&lang=it",
            
success: function(html){
            
            $(
".cat").fadeOut('slow', function() {
                $(
".cat").html(html).fadeIn('slow');
            });
            
                        }
        });
        
        }
</script>