Breaking out of HTML frames

Breaking out of HTML frames cover image
  1. Home
  2. HTML
  3. Breaking out of HTML frames

Here is the situation.

You run a web site that displays HTML documents in frames. Whenever you want to load a page you specify one or the other frame. Feedback from visitors to your site has pointed out that some of them find it difficult to print the “framed” pages. You however, do not want to redo your entire site or lose the ease in site maintenance brought by frames. So you decide to put a link that loads the web page in a full browser window – one without frames – allowing your visitors to print the page. You also do not want to open another window since one of your web design gurus told you that this is a bad idea.

So how do you allow pages to load in the same window from a “framed” web page document to one without frames?

Employ target attribute with “_top” as value in the <a> tag of the link.

<a href="some_frame.html" target="_top">Link</a>

Click here to see how it works. When you click on this link, it will open a browser window with three frames. The bottom right frame has a link which when clicked will display that frame in the full window space.

HTML