Welcome to the OzoneAsylum FaqWiki
Frequently Asked Questions
DHTML/JavaScript

How do I stop direct links from breaking my frame site? Pages that link to <a href="https://ozoneasylum.com/backlink?for=5310" title="Pages that link to How do I stop direct links from breaking my frame site?" rel="nofollow" >How do I stop direct links from breaking my frame site?\

It can be tricky - the simplest approach could just be adding a 'if you aren't viewing this in frames click here' link to get the frames back but there are better approachs involving javaScript. The following script will work although you may want to look into making it more 'fancy':

code:
<body onload="if(top == self) location.href = 'index.html')">



--------------------------
Relevant threads:

How to make sure frames are present

onLoad event Help

--------------------------
Relevant links:

Customized Framesets - following this link shows you the script in action too.

--------------------------
Relevant FAQ:

How do I stop my pages from being framed by another site? - discussing frame busting, the opposite to what is being done here.

--------------------------
Relevant note:

At the time of writing this FAQ was ranked number 1 at Google for the terms stop frame breaking javascript.

____________________
Emperor

(Added by: Emperor on Thu 03-Oct-2002)

(Edited by: Emperor on Mon 03-Feb-2003)

(Edited by: The Spelling Police on Mon 03-Feb-2003)

(Edited by: Emperor on Wed 06-Aug-2003)

« BackwardsOnwards »

Show Forum Drop Down Menu