Ano-Tech Computers
Enter keyword:

How to write a Javascript frame buster
Problem:
When authoring HTML pages, it sometimes becomes necessary or desirable to prevent the page from appearing inside (someone elses) frame set.
 
Solution:
Include the following HTML code somewhere in the document. The script does not need additional configuration, and it can go in the BODY section if you want:

<SCRIPT LANGUAGE=JavaScript>
<!--
if (top.frames.length!=0)
top.location=self.document.location;
// -->
</SCRIPT>

 
Discuss this solution
Did this article solve your problem? Yes No Did not apply

We welcome anyone who is willing to contribute to this public knowledge base, contact siteadmin@atc.no if you have information you would like to share. The idea is not to replace the commercial support sites, but to publish those hard-to-find solutions you've found yourself looking for over and over again.

Show all articles