Unstoppable Domains

Please Wait, Calculating...

Spaceship Spaceship
Watch

Tree

Established Member
Impact
9
I have a page where a lot of charts and graphs are calculated. It can sometimes take 30 seconds or so for the calculations to finish and the charts to be displayed. How can I make it so it displays a message while the charts are calculating. Then when they're done, display them.

I have this code that Jim_ gave me:

PHP:
echo "<div id=\"hidelater\"><b><img src='pages/style/loadingcircle.gif'>  Please Wait, Calculating Chart Output. </b></div>
<script>
function tensecs() { document.getElementById(\"hidelater\").innerHTML = '<b><img src=\"pages/style/loadingcircle.gif\">  This can take quite a long time if more than four ads are selected. Please be patient.</b>'; }
window.setTimeout('tensecs()',10000);</script>"; 
ob_flush(); flush();

// Over 300 lines of chart calculations

echo "<script>document.getElementById(\"hidelater\").style.display = 'none';</script>";

But the charts still display as they're loaded, and when they finish, the little message doesn't go away.

Any help would be appreciated :)
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
If the problem is that the charts are showing up before they are done, don't echo them.

Do something like (where you have // Over 300 lines of chart calculations):

PHP:
<?php

$output = '';

// The 300 lines of chart calculations
$output .= 'The stuff you echoed before, but are now adding to this variable';

echo $output;

?>

This way, it only echo's one time so nothing will show up until you echo it.
 
0
•••
It's showing one chart, then the next one finishes calculating and it pops up, and it all looks very... not good.

Thanks for the idea though. Think I'll try it. :)

But I also get this error :(

Code:
We're glad that you're fond of this member, but please give some rep points to some other members before giving it to Dan Friedman again.
;)

Thanks Dan, that worked beautifully :)
 
0
•••
OMG, your fond of me. ;)

NP.
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99

We're social

Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back