Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q473 Is it possible for a script to check for frames and if present, get rid of them?

You are here: irt.org | FAQ | JavaScript | Frame | Q473 [ previous next ]

You can use the following which checks if the current document is framed:

<script language="JavaScript"><!--
if (parent != self)
    top.location.href = location.href;
//--></script>

or the following which checks if the current document contains frames:

<script language="JavaScript"><!--
if (window.frames.length > 0)
    top.location.href = 'apage.htm';
//--></script>

Feedback on 'Q473 Is it possible for a script to check for frames and if present, get rid of them?'

©2018 Martin Webb