I want to show a loading image before heavy data process and remove it after done, so I wrote this code:
$("a#myId").click(function(){
$(this).append('<img src="loading.gif" />');
...
... doning some heavy data process (that take more that 5 seconds) here ...
...
$("img[src='loading.gif']").remove();
});
But the loading does not show! (when I leave $(this).append('<img src="loading.gif" />'); and remove next lines, loading image display correctly)