开发者

ajax loading progress animation

开发者 https://www.devze.com 2023-02-17 22:32 出处:网络
$(function(){ $(document).ready(function(){ $(\'#demo_content\').html(\'<img src=\"/ajax-loader.gif\"alt=\"Wait\" />\');
$(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 }); });
0

精彩评论

暂无评论...
验证码 换一张
取 消