Link to home
Start Free TrialLog in
Avatar of cnelissen
cnelissen

asked on

Javascript + PHP loading page...

Ok So I am making some reporting functions for some data I have in a SQL database. Some of these queries take a very long time to execute and therefore takes the page a long time to load. I want to make a simple loading page that will display up until the page is fully loaded. I have a rough version of it now, however it still takes a long time for even the loading text to pop-up.

What I need to have happen, is when somebody requests the page a "Loading..." text will appear immediately, and then when it loads, it jumps the actual data...

Here is what I have now :

<html>
<head>
<title>Report</title>
</head>

<body OnLoad="document.all.loading_layer.style.visibility = 'hidden'; document.all.main_layer.style.visibility = 'visible';";>

<div id="loading_layer" style="position:absolute; width:100%; visibility:visible;">
<table width="600" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center">Building Report. Please Wait...</td>
</tr>
</table>
</div>

<div id="main_layer" style="position:absolute; width:100%; visibility:hidden;">
<table width="600" cellpadding="0" cellspacing="0" border="0">
<tr>
<td>SOME PHP CODE HERE</td>
</tr>
</table>
</div>

</body>
</html>

Anybody have any thoughts?
ASKER CERTIFIED SOLUTION
Avatar of kenny9336
kenny9336

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cnelissen
cnelissen

ASKER

No cigar.

If what you say is true, with respect to the page not loading until the </html> tag is read, there is nothing that could be done to speed it up, being that the hang time is coming from the processing of the PHP code, and is read before the </html> tag.

The only problem I see with that reasoning is, I do show the loading message, however it takes upwards of 20 seconds for it to display, but does display after that time, until the page finishes loading.

I think the second idea might be best... Thanks for the input.
i recommand  to accept kenny9336 comment as anser

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question
state should be finalized as the above recommandation

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Nushi
EE Cleanup Volunteer