---
title: "Simple JavaScript ‘Frame Busting’ Code"
url: https://thecancerus.com/simple-javascript-frame-busting-code/
date: 2009-04-16
modified: 2009-04-16
author: "ican"
description: "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..."
categories:
  - "how too?"
tags:
  - "frame busting"
  - "iframe busting"
  - "jail break"
word_count: 62
---

# Simple JavaScript ‘Frame Busting’ Code

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.