|
Q1156 How can I show my main home page and then pre-load other pages in the background?
irt.org | Knowledge Base | JavaScript | Frame | Q1156 [ previous next ]
Q1156 How can I show my main home page and then pre-load other pages in the background?
You need to use frames:
<html>
<head>
<script language="JavaScript"><!--
pages = new Array('page1.htm','page2.htm','page3.htm','page4.htm');
CurrentPage = 0;
function loadNext() {
if (top.CurrentPage > top.pages.length) { /* Are we finished ? */
top.main.location = top.pages[0]; /* Load the first page into main */
}
else top.hidden.location = top.pages[CurrentPage++]; /* load the next page into hidden */
}
//--></script>
</head>
<frameset rows="100%,*">
<frame name="main" src="start.htm">
<frame name="hidden" src="javascript:' '">
</frameset>
</html>
|
and in each of the pages, including start.htm, have
<body onLoad="top.loadNext()">
|
|
|
Copyright © 1996-2008 irt.org, All Rights Reserved.