Home     SSI Lab     CSS Templates     CSS     Htaccess     Web Design     XHTML

Design Tutorials

graphic-img   



How to maintain a frameset.

Bookmark with StumbleUpon
del.icio.us
Digg it
reddit
Furl
Spurl
ma.gnolia
Yahoo MyWeb
Windows Live
Sponsors

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 web sites 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.

Tested in Mozilla Icon Opera Icon IE6 Icon



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"