Reputation: 21
hi i want java scripts for Iframe protection and they work only one site like iframe site url is www.iframe.com and i want to protect on www.my-mainwebsite.com
i just want www.iframe.com work only on www.my-mainwebsite.com when these iframe code use another site like www.anothersite.com they will be redirect to www.my-mainwebsite.com
Upvotes: 0
Views: 1652
Reputation: 19
<script type="text/javascript">
if (top !=self || top.location != "www.iframe.com") {
top.location=self.location;
}
</script>
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.
Edit1:
Upvotes: 1