In Other Sites Frame

Before version 4.0 of either Netscape(NN) or Microsoft(IE) browsers there are potential security and coding issues when a site is viewed in someone elses frames. With version 4.0+ of either browser potential coding errors still exist.

What is "In Other Sites Frame"?
Frames are supported in NN2+ and IE3+. They allow multiple documents to be loaded into sections of the screen. In order for this scenario to occur a website must attempt to load a different website in one of it's frames. This usually done via a link on a web page.

What can happen?
Well here are some issues I know about, there may be more.
There is a potential security risk in both browsers before version 4.0. A site can continue to track your movements, possibly record information you enter at the other site and other nasty things. They could do this from a hidden frame so you aren't even aware it is happening.
In attempt to stop this both IE and NN have implemented security measures in version 4+. Basically they do not allow communication between pages at different sites(unless authorized in code). This in turn can create havoc for sites that use frames when loaded in someone elses frames. Especially when they use complex code that communicates between frames(like my site). In particular(but not limited to) code that references other frames using frames array(FRAMES[1]), and usage of "top","parent" can cause problems. If you use these methods of coding you have code problems in older browser versions as well. Your in a tough spot!.

What can a webmaster do?
Simple, check for the condition and don't allow it. Below is an example of the concept I use for my home page. If my site is in someone elses frames I load a page in the frame warning the client of the potential problems and load my site in a new window. If not I continue with loading.

<script type="text/javascript"> if (top.frames.length != 0){ // Someone attempting to load in frame. rc =""); document.location.href = "/errorpage.htm"; } </script>

Since my site uses frames and uses this solution I will provide a real world example. If you click on Demonstrate Code this page will show a warning message and a new window of my site will open. Be careful, you might not notice a second window has opened. Please note you will not be able to use the basic "Back" button to return to this page. Use down arrow and go back 2 pages or use the toolbar to return to this page.

You could alternately specify the number of frames that must be present by changing the "0" to another number. You would use this concept if this page always loads in a frame document. Another security feature of Walter Moore.Ca