Motyar

Creating value through Programming

FREE VPS for 2 months
DigitalOcean
Cloud hosting for developers
20GB SSD, 512MB RAM - only $5 per month

Mar 23, 2010

break frames - Don’t let your site be framed

I was trying to use my Google profile page in a HTML frame, but they don't let me do so. You should never trust framed services, because they can prevent you.

Here is a simple JavaScript solution.

Code

JavaScript

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

 

Whenever someone paste this page in their frame in will redirect the window to frame href.

Labels:


By :