Any inaccuracies in this index may be explained by the fact that it has been sorted with the help of a computer. --Donald Knuth
Ever thought about trading the markets?
The free NinjaTrader software is the best platform for developers and I've created a course to get you up and running fast!
- Steve @ CambiaResearch
Learn More

How Do I Keep My Website From Being Viewed In a Frame?

Using Javascript to escape frames


Certain websites, such as search engines or email providers, will forward to new web pages inside a frame so they can continue to show their own banner at the top of the page. This, in my humble opinion, is bad form--similar to popups.

You can actually force a browser to load your page and drop the frame using a little bit of javascript. Once again, I don't recommend this because it's generally a bad idea to mess with a person's browser (maybe they like the frame), but I have had occassion to use it when the frames caused problems for web page.

Example: How to escape a frame and load your page in the browser
      <SCRIPT language="javascript">
         if (top != self) 
            top.location = location;
      Test page.

Version: 5.1.20191014.1537