1 min read

Simple JavaScript ‘Frame Busting’ Code

3 comments
ican

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.

Thoughts on This Post (3)

  1. Bhavya

    Was looking for this… Thx 🙂

  2. Jacob

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

  3. camper hire

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