Preventing web pages from load in frames
Sponsored Links
Once your site is well known, other developers might place links to it loading your pages in the same window or another browser window. This is fine since your site is presented the way you wanted it to be.
What if developers load your pages in a frame along with their interface? This almost amounts to stealing data! The problem is aggravated by the fact that you don't know who is doing it or where your pages are ultimately displayed.
Here is a simple JavaScript code protects your pages from being stolen.
<script type="text/javascript">
<!--
if (self != top)
{
top.location.href = self.location;href;
}
//-->
</script>
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.
Page contents: Preventing web pages from your web site to load in a framed document of an external site by attaching a little JavaScript code to these pages.
Comments, questions, feedback... whatever!
Recent Articles
Recent Blog Posts
Popular Articles
- Hotmail Sign In page
- Create a Hotmail account - Instructions
- Create Gmail address
- Download and install Outlook Express
- Get your free Gmail address
- Outlook Express new version
- Create my own email address
- Browers for Windows list
- Get email address
- Color combinations for web sites and pages
- Create Yahoo ID
More web tips & tricks
- Outlook Express Help - tips & tricks (53)
- Windows Live Mail help and tips (36)
- Windows Mail help (25)
- Hotmail help and tips (42)
- Yahoo help & support (45)
- AOL email help (26)
- Gmail help and tips (36)
- Internet tips & tricks (12)
- Web Design tips & tricks (33)
- HTML, Javascript tips tricks (68)
- Web Promotion tips & tricks (8)
- Graphics tips & tricks (20)
