A Service of Martek International
Web http://www.4techies.com

Tips For Webmasters

A Site for Techies by Techies

Automatically Break Out of HTML Frames

Do you have a problem with other websites framing pages at your site and displaying ads at their site that benefit from your content? If so, you are not alone, but the solution is simple. Just add the three lines of code below somewhere between the <head> and </head> tags of web pages at your site that you do not want other sites to be able to frame. It will instantly break website visitors out frames at other websites and will rewrite your web page URL in their web browser address bars so their visitors will be effectively moved (as if by magic) to your site.

  <script type="text/javascript">
if (top != self) top.location.href = self.location.href;

With this code, other webmasters who frame your pages to steal your content will be passing their website visitors to you.