When there is no trigger for loading gif we can use setTimeout dunction to display image
<img src="loading.GIF" id="img" style="display:none"/ > <script> setTimeout(function(){$('#img').show();},30); $.ajax({ type: 'POST', url:' ajaxfile.php', data:{id:123}, success: function(response) { $('#img').hide() }, error :function(response,status) { alert('Error'); } }); </script>
Comments
Post a Comment