Email conversation
| From | Christian Pagé | 
| To | Me | 
| Subject | Prevent web pages to be loaded in iframe | 
| Date | 29 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é.
 
| From | Me | 
| To | Christian Pagé | 
| Subject | Re: Prevent web pages to be loaded in iframe | 
| Date | 29 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/