Create javascript iframe breaker

Posted by Andi Syahputra | 9:08 PM
Just a short tutorial today about iframe.... :D I hope this can give a solution to you. Well, This simple javascript is very useful to avoid your webpages open within iframe. By adding this iframe breaker javascript then each time someone open your webpage via iframe then this javascript will force open your page to the top location (address bar).


Here is a short tutorial how to put iframe breaker script into your template. It support for all platform

- Open your template then find <head> tag

- Add this javascript right below it
<script type='text/javascript'>
if (top !== self) top.location.href = self.location.href;
</script>

- save your template

OK now you can test it by open your webpage via <iframe src='http://yourweb.com'></iframe>

Then the moment the page load, the address bar will change to your URL, escaping your page to load within iframe. So far it's very effective script to prevent your page from iframe.

Perhaps you ask, is there any ANTI iframe breaker? script that prevent iframe breaker and force the webpage to stay in iframe.
FYI, I've tried several ways to make the script like this but it's totally not work. The last time I tried it end with my browser crash.
So I can say now is there's no ANTI iframe breaker script exist yet.

Or maybe you know, so don't hesitate to share your script here... :D
hi folks, visit my other tutorial blog at Kumpulan tutorial menarik
0 comments