[Webinar] Streamline your web hosting managementRegister Today


Script for detecting frames

Posted on 1999-11-11
Medium Priority
Last Modified: 2012-05-04
What script can I use on an HTML page to detect if it is displayed in a frame?
Question by:aquiles
  • 2

Author Comment

ID: 2201725
Edited text of question.

Author Comment

ID: 2201755
Adjusted points to 200

Accepted Solution

barry_d earned 600 total points
ID: 2202785
The following code detects if the page is displayed in a frame. If it is in a frame, it loads the page over the frameset, so it is in frames no longer

<script language="JavaScript">
<!-- Force all the previous frames off
if (self.parent.frames.length != 0) self.parent.location=document.location.href;
// -->

Featured Post

SMB Security Just Got a Layer Stronger

WatchGuard acquires Percipient Networks to extend protection to the DNS layer, further increasing the value of Total Security Suite.  Learn more about what this means for you and how you can improve your security with WatchGuard today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the modern office, employees tend to move around the workplace a lot more freely. Conferences, collaborative groups, flexible seating and working from home require a new level of mobility. Technology has not only changed the behavior and the expe…
A clone is a duplicate copy. Sheep have been cloned and maybe someday even people will be cloned, but disk cloning (performed by the hard drive cloning software) is a vital tool used to manage and protect data. Let’s look at what hard drive cloning …
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
How to fix display issue, screen flickering issue when I plug in power cord to the machine. Before I start explaining the solution lets check out once the issue how it looks like after I connect the power cord. most of you also have faced this…

590 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question