I'm a complete amateur at websites but our golf club delegated the job to me to build their website which I published about a year ago.

The problem is; the site is built in a frame (Left Hand Contents) so the left hand navigation bar remains visible. When found in Google, however, the link takes one to the "Home" page with the left hand frame missing. For the time being I have put a text link below the banner so people arriving via say a bookmark or Google can load the frame.

Is there a Javascript code I can insert in the pages so no matter which page is bookmarked it will load the frame?

I will be happy to e-mail the entire site to anyone if it helps solve this.

Thanks in advance.

Ed

You can add a small script to the head portion of each of your child/inner pages. This script will check to see if it is inside a frame, and if not, redirect back to the home page.

<script language="javascript" type="text/javascript">
if (top == self)
{
  self.location.href = "index.htm";
}
</script>

This assumes that your main page is named "index.htm".

Many thanks for your input. I took a chance and used another forum also and got a very comprehensive response. It is a code that loads the frame at whichever page one bookmarks.

Again, thanks for your help. It's good to know it's available.

Best wishes,

Ed

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.