help with a "please wait ... loading" graphic or t
Moderator: General Moderators
help with a "please wait ... loading" graphic or t
Hi, I am hitting a database and have the potential for a very large found set resulting in a very large page that may take a while to load. Is there a way to create an intermediary "please wait ... loading" image that can be shown on a page while it loads rather than just having to wait on a blank screen?
You might think about breaking the result set up into X amount of data per page with the option to 'continue' on each page. Just like this message board...25 or so posts are shown per page.
Not only is waiting a long time for pages to load very annoying, it is also an unnecessary waste of bandwidth. Causing a serious bottleneck (think of multiple persons doing simultaneous queries), and money.
Not only is waiting a long time for pages to load very annoying, it is also an unnecessary waste of bandwidth. Causing a serious bottleneck (think of multiple persons doing simultaneous queries), and money.
I agree with the above, the best thing to do is try not to send huge results. That having been said, there are times when you just plain have to. Heres what I do in that situation..
A few things to keep in mind.. I don't think this will work if you're buffering your output ( ob_start() ).
You'll want to change the image names to whatever you have, ditto the width and height values, and modify the px values to place the image in the right spot.
Basically this is using CSS inline style tag to slap an image in an exact spot, display the rest of your output, then slap a different image in exactly the same spot. the last displayed goes on top.
I use this a lot, works slick, and it's all server side, no javascript required.
Hope this helps.
Code: Select all
echo "<IMAGE src='loading.gif' style = ' position:absolute; top:50px;";
echo "left: 50px;' width = '320' height = '240'>";
//output 9 gazillion rows from your database...
//and after all that..
echo "<IMAGE src='complete.gif' style = ' position:absolute; top:50px;";
echo "left: 50px;' width = '320' height = '240'>";You'll want to change the image names to whatever you have, ditto the width and height values, and modify the px values to place the image in the right spot.
Basically this is using CSS inline style tag to slap an image in an exact spot, display the rest of your output, then slap a different image in exactly the same spot. the last displayed goes on top.
I use this a lot, works slick, and it's all server side, no javascript required.
Hope this helps.