troubleshooting Question

Javascript + PHP loading page...

Avatar of cnelissen
cnelissen asked on
JavaScript
3 Comments1 Solution2165 ViewsLast Modified:
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
kenny9336

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros