Back to Top
The nuts and bolts for
Creative web development

No framepage escape from frameset

How can I prevent a framepage from being viewed outside of its frameset ?

Answer:

Insert this javascript in the head tags of all the framepages you don't want to be viewed out of the frameset.

<script language="javascript">
<!--
if (top == self) self.location.href = "NAME OF MAIN FRAMESET PAGE";
//-->
</script>

Just set your frameset pages with this code and when a framepage is loaded in the browser while not part of a frameset it will redirect to your main frameset page or the page you specify.

There are also some dedicated extensions that might help you available on the Macromedia Exchange:

Marcellino Bommezijn

Marcellino BommezijnMarcellino Bommezijn is one of the managers at dmxzone.com. He is a contributor on the tutorials section.

Owner of Senzes Media (http://www.activecontent.nl) which provides professional services and web applications for mid-sized companies.

ActiveContent CMS is the ASP.NET Content Management solution that is used for building professional and rich-featured websites.

See All Postings From Marcellino Bommezijn >>

Share this Article