...

View Full Version : Preventing page from rendering in a frame



Mechlar
08-18-2005, 06:37 PM
Is there a way to add something to the body element so that you web page will not show up in someone else's frame. Another example someone makes a web page with frames and one of the frames links to your web site, but you do not want you page to show up in their frame rather a new window?

martin_narg
08-18-2005, 06:59 PM
It's not 100% foolproof but it's normally called a frame-breaker:


if(top.location != document.location) {
top.location.replace(document.location);
}


hope this helps

m_n

Mechlar
08-18-2005, 10:29 PM
Excatly what I was looking for thanks a lot. It works perfect for what I need!!!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum