Are you being framed

If you are being framed for a crime you did not commit it's a job for the police.
but if you find that links from other websites place your pages within their frames please read on.

The majority of surfers dislike frames. Unfortunately the sites that use frames can place links to your sites within their framesets. This will give the impression that your site is one of the dreaded framed sites.

There are three basic ways to avoid being framed.

The way of the Javans

It's possible to make a page that is linked to within a frameset load in the parent window (_top) with the simple use of a simple Javascript. The disadvantage of this method of course is that it works only with Javascript enabled browsers.

However this method has the advantage over the BASE element (described below) in being able to load the site entry page itself in the parent window. Please click here for the script and a demonstration

The BASE element

One of the less well known HTML tags is the BASE tag. It's generaly used to set the default URLS. But it can be used to make the browser load every subsequent page in any frame of your choice
for example:
< BASE href="http://www.webquarry.com/~raditha/" target="_top" >
Whould cause the browser to precede every link it follows with http://www.webquarry.com/~raditha/. The only exeption being when the links begin with http://. But more importantly any page that is linked within a frame will be loaded in the parent window without frames.

The BASE tag has to be entered within the <HEAD> and </HEAD> elements. Please click here for a detailed example and instructions on adding the code to your pages.


Web Design  :  Frame  :  Jail Break!  :  Don't Frame  :  Wizard


Intro  :  FTP  :  HTML  :  Frames  :  Domain Names
Advanced Topics  :  Banner Exchange  :  Meta Tags  :  Links
Home  :  Search  :  Sri Lanka  :  Shareware  :  Mail & News
Web Design  :  What's new  :  What's Cool
Site Map  :  Links  :  Feedback

raditha@webquarry.com, Oct 21, 2003.