Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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()">

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.