<script language="javascript"> if(self.location==top.location)self.location="index.html"; </script>This solution works great; it's easy to add to any page and there's nothing to change. The only bad feature is the site will always load the default home page no matter what URL they actually typed. Some people may find this annoying. It would be really great if the user could simply type the page they wanted to go to and it would automatically load the proper frames with the page they typed in where it should be!
<script language="javascript">
if(self.location==top.location)self.location="index.html?page1.html";
</script>
The example above would redirect to index.html and then load page1.html into the content area instead of whatever the default page would have been. You must put the name of the current page in the script though. So, in page2.html, you have to put "?page2.html". Don't forget: this has to be done to every page EXCEPT the navigation page and the index page.
<script language="javascript">
var fname="content"; //MAIN CONTENT AREA FRAME **NAME**
window.onload=function(){
var d=document.location.search;
if(d!='')top.frames[fname].document.location.href=d.substring(d.lastIndexOf('?')+1,d.length);
}
</script>
The only setting you have to adjust is the frame name. When you set up your frames, you must have given at least the content frame a name. Just enter this name in the script above. This script also assumes the content frame is not nested inside any other frames. If so, you can adjust the script accordingly.
| Paste this JavaScript code into the HEAD section of your index page (the page that sets up the framesets). Don't forget to adjust the frame name in the script! |
<script language="javascript">
var fname="content"; //MAIN CONTENT AREA FRAME **NAME**
window.onload=function(){
var d=document.location.search;
if(d!='')top.frames[fname].document.location.href=d.substring(d.lastIndexOf('?')+1,d.length);
}
</script>
|
| Paste this JavaScript code into the HEAD section of all your content pages. Do not paste this code into the index page or your navigation page. Don't forget to put the page URL in the right place! |
<script language="javascript">
if(self.location==top.location)self.location="index.html?page_URL_here";
</script>
|
| Paste this JavaScript code into the HEAD section of your navigation page. There are no settings to adjust in this one. |
<script language="javascript"> if(self.location==top.location)self.location="index.html"; </script> |