Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Implement a "Please wait while page loads" ?

Status
Not open for further replies.

Tony414

MIS
Feb 3, 2003
197
0
0
US
Hello,
We have a website that connects to a database server. When you click the link it take about 4-5 seconds for the page to come up. I would like to create a "Please wait while the page loads" landing page then connect to the page once done. Any help would be appreciated. Thanks!!
 
You can use a little javascript to handle this...
Code:
<html><head><title>Test</title>
<script type="text/javascript">
function pageLoaded() {
  document.getElementById('waitMessage').style.display = 'none';
  document.getElementById('pageContents').style.display = 'block';
}
window.onload = pageLoaded;
</script>
</head><body>
<div id="waitMessage">Please wait while we do stuff...</div>
<div id="pageContents" style="display:none;">
<?php
  // do your server-side processing at this point
  // and any output gets placed inside this div (which
  // is hidden by default and only shows when the
  // page has fully loaded.
?>
</div>
</body></html>
This approach requires javascript and is only one example of how you could do this.

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
Hi,
I been playing around with this but can't seem to get anywhere. I attached the webpage code for your review. I'm not a pro at this, so be easy on me :)

---------------------------------------------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"<html>
<head>
<meta name="AUTHOR" content=" <meta name="COPYRIGHT" content="&copy; 2008 Vermont Systems, Inc.">
<base href=" <link rel="icon" href="/wbimages/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="/wbimages/favicon.ico" type="image/x-icon">
<title>Town of Guilford Park and Rec Online Registration</title>
<script language="JavaScript" type="text/javascript">
<!-- Hide script from older browsers
if (self.parent.frames.length != 0)
self.parent.location=document.location;
// end hiding contents -->
</script>
<SCRIPT LANGUAGE="javascript">
<!--
var bName = navigator.appName;
var bVer = parseInt(navigator.appVersion);

if ((bName == "Microsoft Internet Explorer" && bVer < "4") ||
((bName == "Netscape" && bVer < "5") || (navigator.userAgent.indexOf('Netscape6') != -1)) ||
(bName != "Microsoft Internet Explorer" && bName != "Netscape")) {
document.write("Your browser version: " + bName + " " + bVer + " does not support some of the features of this website.<br>This website is designed for Netscape 7 and IE 6.0 and above.<br>Please download the latest browser version for free!<br><a href=' target='_blank'>Download Netscape Browser</a><br><A href=' target='_blank'>Download Internet Explorer</a>");
}
//-->
</SCRIPT>
<NOSCRIPT>
<META HTTP-EQUIV="Refresh" CONTENT="2;URL=http://www.guilfordparkrec.com/pleaseupgrade.html">
</NOSCRIPT>
</head>

<frameset cols="100%,*" frameborder="NO" border="0" framespacing="0" >
<frameset rows="100%,*" frameborder="NO" border="0" framespacing="0" >
<frame name="main" src="wb1000.html" title="WebTrac by Vermont Systems, Inc." frameborder="NO" marginwidth="0" marginheight="0" scrolling="yes">
<frame src="UntitledFrame-2"></frameset>
<frame src="UntitledFrame-3"></frameset>

<noframes>
<body>
<p>If your browser does not support frames, please download the latest browser version for free!</p>
<p><a href=" target="_blank" tabindex="1"><img border="0" alt="Get Firefox!" title="Get Firefox!" src="/wbimages/getfirefox_sm.gif"></a> &nbsp;&nbsp;&nbsp;&nbsp;
<a href=" target="_blank" tabindex="2"><img src="/wbimages/ie7logo_sm.gif" alt="Download Internet Explorer Free" border="0" height="30"></a> &nbsp;&nbsp;&nbsp;&nbsp;
<a href=" target="_blank" tabindex="30"><img src="/wbimages/badge1_sm.gif" alt="Netscape NOW!" title="Netscape NOW!" border="0"></a></p>
</body>
</noframes>
</html>
 
Because you are using a frameset, you should put this code in your "main" html document (that is loaded into one of the frames - probably in wb1000.html) - that will then do what you want.

As an aside, Netscape is no longer - so maybe adjust the text/links that are being used to promote it (maybe sneak in a link for Opera or even Safari) [smile]

Cheers,
Jeff

[tt]Jeff's Blog [!]@[/!] CodeRambler
[/tt]

Make sure your web page and css validates properly against the doctype you have chosen - before you attempt to debug a problem!

FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top