Simple JavaScript ‘Frame Busting’ Code

April 16th, 2009 | Save to del.icio.us now(0)

Here is a quick JavaScript  code that you can use if you want to make sure that no one should be able to show your website in an IFrame.

<script type="text/javascript">
if (top !=self) {
   top.location=self.location;
}
</script>

Just put this code in head section of your html page, and it will ensure that your page always get’s displayed outside the frames.

Related posts

  1. Fix ‘Blank page’ problem aka White Screen of Death
  2. Media Manager Browse Button Disabled In Joomla
  3. Configuring wireless routers
  4. Easy File Uploading Solution For PHP
  5. Solution To Session Timing Out Intermittently

Wondering what to do next?


(Search web development related contents)


3 Responses to “Simple JavaScript ‘Frame Busting’ Code”

  1. April 29, 2009 1:21 pm Bhavya says

    Was looking for this…
    Thx :)

  2. October 21, 2009 4:04 pm Jacob says

    Thanks a lot for the help. This script works awesome.

  3. October 29, 2009 12:26 pm camper hire says

    Thanx this really helps me out…
    **************************
    Jack Brosnan
    camper hire

Trackback URI | Comments RSS

Say Something, and Be Counted

Name (required)

Email (required)

Website

Speak your mind