My Web Design Pet Hates:
FRAMES!!
No, I am not going to go over all the old arguments against using frames on web sites. That subject has been done to death already. My advice is just don't use them. No, my latest pet hate is web sites that appear stuck inside someone else's frame set.
You must have seen this weird occurrence during your travels around the web. You are on a web site that uses frames (hey, just don't go there!). There is a link on the page to another site. You click on the link and - hey presto! - the new web site opens up with the frames of the original site around it....Why???
It would not be fair of me to name any particular sites for this heinous crime. So, if you are not sure what I am talking about, have a look at this demonstration which will open in a new browser window. If you are using a browser that does not support frames, sorry, but you won't be able to see this demonstration
What are the people who design these sites thinking of? Why would anyone want their web site stuck in the middle of someone else's frame set? There are several ways to stop this happening, but this is the easiest.
Solution:
This is how we do it on this site. Put the following lines of code between the <HEAD>
tags on all your web pages. This will effectively inoculate any page against getting stuck within another frame set.
<script language="JavaScript" type="text/javascript">
<!--
//If someone else tries to display this page within a frame, break out.
if (parent.frames.length > 0) {
parent.location.href = location.href
}
//-->
</script>
This little bit of Java Script code was written by Alan Simpson at www.coolnerds.com
Of course, the web mistresses and web masters of sites that do use frames, also have a part to play. If you have a link to another site on a page within a frame set, you should always include target="_blank" within the link. Then that link will open in a new browser window. Unless of course you want people trapped within your frame set ...
So a typical link to an external site would look like this:
<a href="http://www.wherever.html" target="_blank">link</a>
If you have a particular "pet hate", please do share it with me!
Comments and feedback on this article are most welcome.
send feedback
© ziskadesigns. Date last modified: 20.10.00
|