|
Web Design Tutorials
|
|
How to maintain a frameset
Introduction.
One common problem for people who are inexperienced with frames or who have not yet
acquired the knowledge is that people visiting their framed websites from search engines often
find an individual page which should be part of a frameset. It means the visitor can access
the content frame without the other frames which may contain logo or other headers; site navigation;
copyright information etc. This problem is easily overcome.
Basic Code:
If a single page which should be part of a frameset is loaded without the other frames then it
needs to be forced back into the frameset. To do this simple add the following code to the
<HEAD> of your document:
<SCRIPT LANGUAGE="JavaScript">
<!--
if (window.parent==window)
location.href = 'index.htm';
//-->
</SCRIPT>
Note 1: index.htm in this example is the main URL of your frameset page. Some people use default.html etc
Note 2: this code must be put into EVERY page on your site
which belongs to a frameset except your main frameset page "index.htm"
|
|