Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to avoid being framed

Status
Not open for further replies.

daveask

Programmer
Joined
Aug 11, 2004
Messages
108
Location
GB
Hi Experts,

To avoid being framed without my permition, I included following JavaScript code
if (top != self)
{
window.location="......";
}
However, somebody can still frame my site. Following is his JavaScript code I found from the source:
document.write('<frameset .......>');
document.write('<frame ...... >');
document.write('<frame name="......" src="' + url + '">');
document.write('</frameset>');

Any idea? What I should do to avoid that??

Thank you in advance.
 
Try this:

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

Regards


Jakob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top