title: Jquery:: Ajax powered progress bar?
body: <p>I have a page which uses jquery's ajax functions to send some messages.</p>
  
  <p>There could be upwards of 50k messages to send.</p>
  
  <p>This can take some time obviously.</p>
  
  <p>What I am looking to do is show a progress bar with the messages being sent.</p>
  
  <p>The backend is PHP.</p>
  
  <p>How can I do this?</p>
  
  <p><hr />
  My solution:
  Send through a unique identifier in the original ajax call.<br>
  This identifier is stored in a database(or a file named with the identifier etc), along with the completion percentage.</p>
  
  <p>This is updated as the original script proceeds.</p>
  
  <p>a function is setup called <code>progress(ident)</code></p>
  
  <p>The function makes an ajax call to a script that reads the percentage.<br>
  the progressbar is updated
  If the returned percentage is not 100,<br>
  the function sets a timeout that calls itself after 1 second.</p>