“Kill Frames” Javascript Code. Do You Really Need It On Yur Site?

Soon after discussing the use of framesets by newly relaunched LeapFish I received a question from dozen of readers and visitors asking me how they can prevent their website from “being framed” by other websites.

To prevent your website from being from being viewable in a frame of another website you can add the piece of the following code just above </head> tag on your website:

<SCRIPT TYPE="text/javascript">

      <!–
      if (top.frames.length!=0)
            top.location=self.document.location;
      // –>

</SCRIPT>
 

Before you do it you need to really be sure it is what you want it. There are many good websites out there that use frames to view your website- StumbleUpon is one of those good sites.

The above code also relies on whether or not your visitors browser is configured to support Javascript, you would be surprise how many users out there do not enable Javascript support on their browsers.

The above Javascript code “forses” user’s browser to open your page in it’s own window. Before my previous post I have never considered using it on my website and still do not think there are any huge benefits from implementing it on yours.

I would like to hear what you have to say. What are the reasons for using the above code? If you don’t recommend to use it – why not?

Of course I would also love to hear about any other way to “kill frames” – please share them in the comments if you know any.

If you are interested to find out more about LeapFish I highly recommend LeapFish Review by Better Business Bureau.

Similar Posts:

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment