Display dialog while page is loading

Display dialog while page is loading

Hello,

I want to display a dialog with a busy indicator on it while my page is loading. Then, when the page is fully loaded, I want the dialog to disappear. Using output buffering, I can flush the buffer containing the code I want to display then continue with server side processing. I put the following line in my code but the dialog doesn't display until after the whole page loads.

  1. <body>
  2. <script>
  3. $("#progressdialog").Dialog();
  4. </script>
I'm loading the jQuery scripts in the head section which is also in the portion that is flushed.