tags:

views:

79

answers:

1

Hi;

I'm using the Queued Ajax requests/Synced Ajax to call time.php ( this is heavy php file ). I would like to be able to add a loafing massage ( or a loading.gif ) while the Queued request is executed , so the user has some indication the something is running . here is my code :

<script>
$(function(){
    jQuery.ajaxQueue({
        url: "time.php",
        // do not show file
        success: function(html){ jQuery("ul").append(html); }
    });
    jQuery.ajaxSync({
        url: "time.php",
        success: function(html){ jQuery("ul").append("<b>Loladed File 1</b><BR>"); }
    });


});

});
</script>

thanks jeff

A: 

In the past when doing something similar (using the ootb ajax functionality) I've used something similar to the following to add loading images -

if ($("#loadimg").attr("src") != "/static/icons/loading.gif") {
            $("#loadimg").attr("src", "/static/icons/loading.gif");
        }

if ($("#loadimg").length < 1) {
$(this).parent().append("<img id=loadimg src='/static/icons/loading.gif'>");
        }

Add something like that to your event handler that is handling your ajax requests and then just add a div/span/img tag wherever you would like the image to load like

<div id="loadimg" src="/static/icons/blank.gif">
HurnsMobile
hi HurnsMobile;I tried this , but noting is showing ? any advise .thanks....