Reputation: 256
I want to show a gif image while the page is loading using javascript. What am i doing wrong ? :/
$("#basicReport").click(function() {
$('#loader').html('');
$("#loade").show();
$("#loader").load("BasicReports.php", function () {
$("#loade").hide();
});
});
and i have the div here :
<div id="loader" class = "paddleft" >
<div id="loade"> <img id="" align="center" src="load.gif"></div>
</div>
Upvotes: 1
Views: 705
Reputation: 5356
$('#loader').html('');
remove this .html has remove #loader tag
Upvotes: 0
Reputation: 64526
Move the gif container out of #loader
because you're destroying the gif when you do .html('')
:
<div id="loade"> <img id="" align="center" src="load.gif"></div>
<div id="loader" class = "paddleft" >
</div>
Upvotes: 5