If you have studied the Ajax basic tutorials then this is not so difficult to understand. We will try to develop a progress bar which takes the inputs from a php file ( server side script ) and display the result.
Displaying the progress bar
To display a progressing bar we will use one small image of fixed height and width. The width we will change ( or increase ) based on the data we receive from the php file by Ajax. This is the code we will keep inside the div tag to display the progress bar.
In this code we will be calling our ajaxFunction() at 10 sec interval as long as the width is less than 200.
Our server side PHP code.
There is nothing much in this code. We will only receive the existing width value and then increase by 20 and then return.