Click to See Complete Forum and Search --> : Page Loading
phusion
05-14-2003, 09:04 PM
Does anyone know how to code a Page Loading script that will automatically load a page after the information has been finished being obtained. Sorry that probably sounds confusing. I will explain the scenario:
A user logs in, upon login information regarding their real estate listings is pulled in from our database. The access can take some time so I was hoping to be able to display a page loading page first. I do not want a timer as everyones page load would be different. Having an image page load also will not work, I need one for when it is complete from accessing the database? The access method to the database is ASP. Any help would be appreciated.
I can think of one way that would probably work to do it, but it relys on javascript to display the page, so you are going to have to ask yourself if it is worth the page not displaying for the 10% of people without javascript, simply to preload the page. I can answer that for you.... It's not...
phusion
05-14-2003, 09:33 PM
I would be interested in seeing what the script would be. I am not really worried about the people that do not support javascript. It is a product that is only written for IE 5 and higher as well as Netscape 5 and higher. Thank you for your help.
Ok, try this out. I threw an <iframe> loading Yahoo! so you could see that it is working...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript" type="text/javascript">
function loadPage() {
document.getElementById("beforeloaded").style.display = "none";
document.getElementById("afterloaded").style.display = "block";
}
</script>
</head>
<body onload="loadPage();">
<div id="beforeloaded" style="display:block;">Please wait while the page is loading</div>
<div id="afterloaded" style="display:none;"><iframe src="http://www.yahoo.com"></iframe></div>
</body>
</html>
So, basically, you include your preloading text in the div with the id of "beforloaded" and your normal page in the div with the id of "afterloaded"...
phusion
05-14-2003, 10:17 PM
Thanks that was exactly what I was looking for.