var count = 0; jQuery(document).ready(function(){ jQuery.ajax({ type: "post",url: "admin-ajax.php",data: { action: 'test', _ajax_nonce: asaAJAX.nextNonce }, beforeSend: function() {jQuery("#loading").show("slow");}, //show loading just when link is clicked complete: function() { jQuery("#loading").hide("fast");}, //stop showing loading when the process is complete success: function(html){ //so, if data is retrieved, store it in html jQuery("#helloworld").html(html); //show the html inside helloworld div jQuery("#helloworld").fadeIn("fast"); //animation } }); //close jQuery.ajax( })