灵活的进度条

I have a long pending question about the progress bar in Ajax which I need to clarify. The question is that when we do any action in Facebook and the site is waiting for a response from the server the progress bar appears on different parts of the page..

Facebook couldn't have installed 100's of these progress bars (this what I think). There must be an object created and every time there is a request sent to the server, this object is called. What is the solution, using JavaScript or Ajax or whatnot?

Have you seen the source code for Facebook?

They probably have a function in each ajax call that goes over every loading bar placeholder and makes it show the loading bar.

Start by reading the documentation for jQuery's $.ajax, and especially the global Ajax events.

All you really have to do is create a progress bar (can be done easily with jQuery UI) and bind it to the global Ajax events to make it work whenever an Ajax call is being made. With the built in progressbar in jQuery UI you can update the progressbar with the actual percent completed in the Ajax call.

The rest is just css placement of the progressbar itself on the page.