"Loading" icon
Posted: Fri May 12, 2006 7:53 am
Here's a common question for y'all.
Just looking to pick your brains on ways to have a page display a static image or a div while it's waiting for the server to send back data. There may even be some server-side trickery that can be done to make my current implementation work.
What I have at the moment work while data is physically downloading to the page. I have a div that has display set to "block" and an onload event in the <body> which sets it back to display: none. This works, but only once the server has responded and started sending data.
Any idea how I could do something like that while the server is working? I attempted placing an onclick handler in all my hyperlinks to make that little div display again but it doesn't work because once the browser starts waiting for the server to respond nothing happens inside the window.
Could I do something with output buffering perhaps to send back that first bit of data even if the application is still processing some long-winded task?
Just looking to pick your brains on ways to have a page display a static image or a div while it's waiting for the server to send back data. There may even be some server-side trickery that can be done to make my current implementation work.
What I have at the moment work while data is physically downloading to the page. I have a div that has display set to "block" and an onload event in the <body> which sets it back to display: none. This works, but only once the server has responded and started sending data.
Any idea how I could do something like that while the server is working? I attempted placing an onclick handler in all my hyperlinks to make that little div display again but it doesn't work because once the browser starts waiting for the server to respond nothing happens inside the window.
Could I do something with output buffering perhaps to send back that first bit of data even if the application is still processing some long-winded task?