ajax loading progress animation
$(function(){
$(document).ready(function(){
$('#demo_content').html('<img src="/ajax-loader.gif"alt="Wait" />');
$('#demo_content').load('/myphp.php?nice=1149632');
$("#demo_content").html('');
return false;
cache:false
});
});
This script will load my data into the page but I cannot get my loader image to display while开发者_如何学运维 the ajax is loading. Can anyone give me advice as to how I would edit this to function correctly? Thank you.
The $("#demo_content").html('');
line removes the image immediately before it's displayed. You should remove it and try again.
$(function(){ $(document).ready(function(){ $('#demo_content').html(''); $('#demo_content').load('/myphp.php?nice=1149632'); return false; cache:false }); });
精彩评论