Christian Pagé

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromChristian Pagé
ToMe
SubjectPrevent web pages to be loaded in iframe
Date29 June 2005 14:01
Hello,

I have a problem because some websites embed some of my webpages in  iframe,
and they should not do it for a few of my webpages.
Is there a way to prevent inclusion of a page in an iframe using php  or
javascript?

Many thanks,

Christian Pagé.
FromMe
ToChristian Pagé
SubjectRe: Prevent web pages to be loaded in iframe
Date29 June 2005 15:55
Christian,

> Is there a way to prevent inclusion of a page in an iframe

Easy, but not always a good idea:

if( self != top ) { top.location = self.location; }

but be warned that this can sometimes cause accessibility problems, and may
cause problems with people accessing the page from search engines.


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.