Solved

Wipe out frames

Posted on 1998-11-11
13
178 Views
Last Modified: 2010-04-09
I want to put code in my pages that will wipe any existing frames in the browsers so I can create my own frames without being in someone elses.  
0
Comment
Question by:annakellers_pg
13 Comments
 
LVL 5

Expert Comment

by:thoellri
ID: 1839599
TARGET=_top ???

0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1839600
Here is the script code:

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

This will check to see if the current page is the "top" document.  If it is not, it will make itself be the top.


0
 

Author Comment

by:annakellers_pg
ID: 1839601
Solution not working.
Situation: My site has the browser broken up into 3 frames.
<HTML>
<HEAD>
<META NAME=”description” CONTENT=” Anna Kellers Advanced Site”>
<META NAME=”keywords” CONTENT=”Training, HTML, JAVAScript, JavaScript,
JAVA, Developer, C, Client/Server, Keller, Anna”>
<TITLE>Technical Tutorials, Travel, Reading/Writers</TITLE>
</HEAD>
<!--- 3 Frames split into 2 rows with the 2nd row 2 columns --->
<FRAMESET ROWS="25%,*" border=1 frameborder=2 framespacing=1>
<!--- Frame for Sponsor --->
<FRAME SRC="geostuff.html" name="SPONSORAK" marginwidth=0        
scrolling=”no”>
<FRAMESET COLS="75%,25%" border=1 frameborder=2 framespacing=1>
<!--- Frame for Pages --->
<FRAME SRC="homeak.html" name="PAGESAK" marginwidth=1 scrolling="AUTO"
frameborder=2>
<!--- Frame for Menu --->
<FRAME SRC="menuak.html" name="MENUAK" marginwidth=1 frameborder=2
scrolling="AUTO">
</FRAMESET>
</FRAMESET>
</html>

My subpages run in frame PAGESAK and on those pages is
a return to my home page (just incase they get to a
page without going through my site homepage/frames)
which is a link to above html.  Now PAGESAK fills with
frames, when what I actually want is the original
frames zapped and the new frames opened (instead of
new frames opened within the PAGESAK frame in the currently
subdivided browser).

-----------------------------------------
|  SPONSOR STUFF --- STAYS THE SAME     |
-----------------------------------------
|                             |         |
|                             |  Menu   |
|  Dynamically Changing Pages |  Stays  |
|                             |  The    |
|                             |  Same   |
-----------------------------------------

please help ... we're getting closer.

0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1839602
Place the script that I noted above in the Frame Definition page.  before the <HEAD> statement.

It will destroy the frames.
0
 
LVL 28

Expert Comment

by:sybe
ID: 1839603
MasseyM's suggestion should work. I believe that some browsers don't like the "href" after location. Try it without href:

<script language="JavaScript">
<--
if (top.location != document.location)
  top.location = document.location;
// -->
</script>
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1839604
Actually the most compatible version is
<HTML>
<HEAD>
<META NAME=”description” CONTENT=” Anna Kellers Advanced Site”>
<META NAME=”keywords” CONTENT=”Training, HTML, JAVAScript, JavaScript,
       JAVA, Developer, C, Client/Server, Keller, Anna”>
<TITLE>Technical Tutorials, Travel, Reading/Writers</TITLE>
<SCRIPT LANGUAGE="JavaScript"><!-- // cloak
if (self!=top) top.location = self.location.href;
// uncloak --></SCRIPT>
</HEAD>
<FRAMESET......

Michel
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1839605
All these examples will however break the back button so perhaps

if (self!=top) setTimeout("top.location = self.location.href",3000);

is a more gentle method...

Michel
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 50 total points
ID: 1839606
I am too tired today. Here is the really friendly version:

<HTML>
<HEAD>
<META NAME=”description” CONTENT=” Anna Kellers Advanced Site”>
<META NAME=”keywords” CONTENT=”Training, HTML, JAVAScript, JavaScript,
 JAVA, Developer, C, Client/Server, Keller, Anna”>
<TITLE>Technical Tutorials, Travel, Reading/Writers</TITLE>
<SCRIPT LANGUAGE="JavaScript"><!-- // cloak
if (self!=top) {
   if (location.replace) top.location.replace(self.location.href);
   else setTimeout("top.location = self.location.href",3000);
}
// uncloak --></SCRIPT>
</HEAD>
<FRAMESET...

Michel
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1839607
Basically what I said:
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1839608
Yep

Michel
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1839609
So, you just repost my answer?  I don't really get it.  Ok, I see.

0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1839610
Come on MasseyM, there is a little more to my answer than a repost if you see my 2 preceding comments... Anna could split the points - or I could post some points. I just felt I had added enough to merit an answer.

Michel
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 1839611
Thanks. Please ask Linda in customer services to help you give some points to MasseyM

Michel
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Angular 2 complaining about map file 7 55
Popup to change image and store url in database 2 31
Download a website to hdd 2 50
Split in Javascript 5 31
Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

895 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now