With an iframe command we can display the contents of other websites within our own website or blog. This of course can be beneficial for those who put an iframe, but instead for website owners who installed the iframe is harmful because it does not get the actual number of visits and can take bandwidth on the website (if hosting his own).

How to avoid that other people can not put an iframe for our blog? An easy way, by simply installing a simple script, you can avoid the theft of an iframe code.

An easy way, by simply installing a simple script, you can avoid the theft of an iframe code.

Simple steps you can do is to install the following script in your template <head> section.
<script type="text/javascript"> <!-- Hide Script if (top.location != self.location) { top.location = self.location } //End Hide Script--> </script>

or you can also use the following script:
<script type="text/javascript"> <!-- if (parent.frames.length > 0) { parent.location.href = location.href; } --> </script>

For users of WordPress, the themes usually have a file called header.php, open the file and look for the code </head>, then copy and paste the script that was right above the code </head>. However, if you want practical, you could use a break out of frames plugin.

In addition, anti iframe script also to avoid the installation of an iframe by google image or digg, so it will likely get a number of requests for more. One example of a website that implements the above code is http://fliptextgenerator.com. To prove that the script above works well, please put your iframe code below on the sidebar of your blog.
<iframe align="left" frameborder="0" src="http://fliptextgenerator.com" width="200" height="200" scrolling="no"> </iframe>

Once the script above is installed, then please open your blog page and see the results.

1 comments:

are this is work in blogspot?

qqqqq

Just Comment. Not Spam!