Last month, I found out that someone was loading one of my pages in his website using a frame. Whenever the website is loaded, my page will appear as if it was the owner’s. I do not know what this person is trying to do or gain from it but I found a method to defeat it.
How does it work?
The paragraph below is quoted from the article. It explains how and what the code does.
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.
I have tried it out and it works like a charm. Try clicking here to check out the previous website that was loading my page in a frame. Now, the page redirects to my original page. Notice the URL at the top of the page shows it is loaded from my blog.
If you want to prevent others from loading any of your pages in a frame, use the code provided above.