• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

7. Managing Multiple Frames > 7.5. Avoiding Being “Framed” by Another Site

Avoiding Being “Framed” by Another Site

NN 2, IE 3

Problem

You want to prevent your site from appearing within another site’s frameset.

Solution

Include the following script statements at the very top of a script appearing in the head portion of the document:

if (top != self) {
    top.location.href = location.href;
}

If you are using a frameset, include this script only in the framesetting document’s script, and not in the documents that appear in the frames.

Discussion

The act of framing someone else’s site is less prevalent than it was some years ago, but it can still happen. Sometimes it occurs innocently enough, when another site includes a pointer to your site but the link is part of a frameset navigation system, where all link destinations are loaded into a content frame of the site. Whether you are concerned that your site appears in a frame of someone else’s site is a personal issue. A corporate site usually desires control of the user’s experience at the site, and doesn’t wish to have someone else’s banner advertising appear in the same browser window as its own pages. Also, being in someone else’s frameset makes it less likely that the visitor will correctly bookmark your site. Not all users—esp....


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint