Leaving a Frame

If a Frameset is used it is still possible to view the contents of a frame in a normal browser window.

EG:

You are now viewing a framed layout and this page is loaded into my Main Frame.

Clicking the following link will disperse my frameset and view this page in a normal window.
You can return to the frameset by right clicking and selecting the back option from the context menu or the Return link on this page.

Normal Link <a href="thispage.htm" target="_parent">Normal Link</a>

Putting in a Return link would let them return to the frameset

Return <a href="#null" onclick="history.go(-1)">Return</a>

The following script will do the above.

<script type="text/javascript">
<!--
function noframe(){
if(self.parent.frames.length!=0)
self.parent.location=document.location
}

// add onload="noframe()" to the opening BODY tag

//-->
</script>

No Frame

<a href="#null" onclick="alert('You are now leaving this frame layout\n\nTo return right click and select the back option on the context menu');noframe()" >No Frame</a>

And the Back button;

Return

<a href="#null" onclick="alert('You are now returning to the frames layout'); history.go(-1)">Return</a>


Place the following into the <head> section and the page will not be loaded into a frameset

<script type="text/javascript">
<!--
if (window!= top)
top.location.href=location.href
// -->
</script>

or

<script type="text/javascript">
<!--
if (parent.frames.length > 0) {
parent.location.href = location.href
}
//-->
</script>