Jump to content

How can I have a progress bar for this


TeddyKiller

Recommended Posts

I have some ajax code, done in jquery. I'm wanting a progress bar. The page takes so long to load. It can be 1 second, or it can take minutes. It all depends on whats exactly happening with it. Lets say a clan has 10 clan members. It updates those users with information grabbed by another site. This will give it time.

 

So with the ajax script, where it has "loading" I'd like some sort of progress bar, so that no matter how long it takes for the results to display from the other page, it'll always display them when the progress bar reaches 100% if you get me.

 

How can I do it?

$(function() {     
    $(".button").click(function() {
        URL = $(".URL").val();
        
        $("#flash").slideDown("slow").html('<span class="loading">loading</span>');

        $.ajax({
            type: "POST",
            url: "usercp/updateusers.php",
            data: {url: URL},
            cache: false,
            success: function(html){
                $("#results").prepend(html);
                $("#results").slideDown("slow");
                document.getElementById('memb').value='';
                document.getElementById('memb').focus();
                $("#flash").hide();
            }
        });
        
        return false;
    });   
});

Link to comment
Share on other sites

Note: In the PHP File, we have a script that displays some usernames. Though with our method, it displays all the usernames at once, instead of one at a time. Can this be changed so that it does display 1 by 1.. instead of the ajax waiting until all is completed, and then display. The progress bar should display and load etc.. until the last username has been done.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.