Last post Jun 21, 2012 03:59 PM by RichardD
May 30, 2012 01:42 AM|mohith.net|LINK
Sometimes other web developers try to steal or use our data with the help of frames, no matter if they are quoting that the contents are retrieved from our website (because we'll get some free publicity and crebility) but what if they use it with their own
interface and give build up as it is their own? Even, we can't find which sites are retrieving our web page in frames. So, here is a simple solution to fix it (preventing other websites loading our pages in frames)
if (self != top)
top.location.href = self.location;href;
The code tests whether the top page is the same as the page being displayed. If this is not the case, the URL of the top page is changed to the URL of the present page. Thus, your page always loads in a full browser window the way you wanted it.
Place this script in the HEAD section of each document you want to protect.
Jun 13, 2012 02:49 AM|sean freeman|LINK
so, is there no way of testing on the server side if the requesting browser is gonna load it in a frame. if so,
then we don't give anything to user. and server is faster than browser and one "if" statement is ignorable.
Jun 21, 2012 03:59 PM|RichardD|LINK
For modern browsers, the
X-Frame-Options header is a more robust solution.