Jump to content
xisto Community
iGuest

Ajax Loading Bar How do you do it?

Recommended Posts

Hi,I've seen some sites around that use ajax alot, for loading pages, images etc. And I've noticed that, instead of just showing a picture or text while loading, they have a loading bar. How do you do that? Is there any way of finding out how much of something in ajax has loaded, and use a loading bar to show it?

Share this post


Link to post
Share on other sites

No, that's not quite what I'm looking for. They're just animations that loop while it's loading. I need a loading bar that'll progress as it loads.

Share this post


Link to post
Share on other sites

something like a flash loading bar i gather in flash games and that. the ones that move as it loads. is that wot u want?

Share this post


Link to post
Share on other sites

The ExtJS javascript library has a progress bar that you can use, also it offers a lot of interesting things that you can use to develop a complete web application.

Visit ExtJS 2.0 for more information.

Best regards,

Share this post


Link to post
Share on other sites

Ajax doesn't have any progression notice, if you find the four modes it's just request send, request recieved, being worked on, and come back. The best you could do is quarters, which like all ajax scripts would be by the statechange.edit: Yeah, your link, the first two, with the four stages are more true, but the other two are more expected. Depends what you are after Habble, true or fluid.

Edited by toby (see edit history)

Share this post


Link to post
Share on other sites

Ajax doesn't have any progression notice, if you find the four modes it's just request send, request recieved, being worked on, and come back. The best you could do is quarters, which like all ajax scripts would be by the statechange.

Yeah, you are right, ajax doesn't have any progression notice, but i think that a simple way to simulate this is when you start the request you also start the progress bar and when the request is complete stop it.
Take a look to the Ext JS Progress Bar Example.

Best regards,

Share this post


Link to post
Share on other sites

No, that's not quite what I'm looking for. They're just animations that loop while it's loading. I need a loading bar that'll progress as it loads.

This is only to illustrate the idea:

<script language='javascript'>

// XMLHttpRequest object callback function
function callback() {

// get current position of progress bar ( 0 .... 100 )
var pos = XMLHttpRequestObject.responseText;
.....
document.getElementById('myElement1').width = pos;
}

</script>

<table border=1>
<tr>
<td id='myElement1' width=0 height=15 bgcolor='blue'></td>
</tr>
</table>
Edited by java-area (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.