Nov 25, 2009

Ajax Loading Bar - How do you do it?

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Programming > Scripting > JavaScript

Ajax Loading Bar - How do you do it?

Habble
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?


Comment/Reply (w/o sign-up)

toby
http://www.ajaxload.info/

Not pretty imo.

Comment/Reply (w/o sign-up)

Habble
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.

Comment/Reply (w/o sign-up)

Sten
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?

Comment/Reply (w/o sign-up)

TavoxPeru
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,

Comment/Reply (w/o sign-up)

toby
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.

Comment/Reply (w/o sign-up)

TavoxPeru
QUOTE(toby @ Feb 24 2008, 12:00 PM) *
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,

Comment/Reply (w/o sign-up)

java-area
QUOTE(Habble @ Jan 6 2008, 08:58 PM) *
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>

 

 

 


Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)


See Also,

*SIMILAR VIDEOS*
Searching Video's for ajax, loading, bar,
advertisement



Ajax Loading Bar - How do you do it?

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com