META name="y_key" content="24902eb207816366"> tuduytuonglai: Anti Iframe Script

24 tháng 7, 2010

Anti Iframe Script

Kang Rohman once wrote about Iframe at the article of Knowing the frame order, that with Iframe, we can display the content of other websites on our website or blog. Of course, this will give the advantages to the owners of websites that install the Iframe, but not for owners of websites, where their websites are installed with the Iframe because their websites will not get the real visits even their bandwidth can be reduced (if it is self-hosting).
For those who host their blogs at blogger, of course, it’s not a problem because blogger has the unlimited bandwidth, but they will only get the fake visits . However, for those who host their blogs or websites at self-hosting, this may be a serious problem, but do not worry because there is a solution. So what is the solution to avoid Iframe installed by others at our blogs or websites? It’s so simple. There is a simple script to be installed at our blogs or websites in order to avoid stealing Iframe code.
The simple way to conduct is by installing the following script in the header of your template.

<script type="text/javascript">
<!-- Hide Script
 if (top.location != self.location) {
   top.location = self.location
 }
//End Hide Script-->
</script>
Or you can use the script below:

<script type="text/javascript">
<!--
if (parent.frames.length > 0) { parent.location.href = location.href; }
-->
</script>
If the script is installed in your blog or website, the Iframe installed at your blog or website will be useless because the script will automatically redirect to your blog or website.
If you haven’t caught this trick or are confused how to install the script, just follow the following steps:
For blogger:
Please login to blogger with your ID.
  • Click Layout
  • Click Edit HTML tab
  • Find the code </head>
  • Copy and then paste the following code exactly above the code </head>
    <script type="text/javascript">
    <!-- Hide Script
     if (top.location != self.location) {
       top.location = self.location
     }
    //End Hide Script-->
    </script>

  • Click SAVE TEMPLATE.
  • Done
For wordpress.org users, you will find the file of header.php in your theme. Open the file and find out the code </head>, and then copy paste the script exactly above the code </head>. But if you want the most practical way, you can use and install the break out of frame plugin.
In addition, the anti iframe script is also to avoid the iframe installment by Google Image as well as Digg, thus having the more chances to get more visits. One example of website implementing the code above is http://fliptextgenerator.com. To prove that the script can work properly, please install the 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>

After installing the script, please open your blog and see what happens.

0 nhận xét:

Đăng nhận xét


♦ Mời bạn gửi Nhận xét của mình. Nếu không có tài khoản Blogger-Google, LiveJournal, WordPress, TypePad, AIM, OpenID, bạn vẫn có thể nhận xét bằng cách chọnComment asTên/URL hay Ẩn danh. Tuy nhiên bạn nên chọn Tên/URL với URL có thể để trống. Bạn vui lòng gõ tiếng Việt có dấu.

♦ Bấm vào Xem trước [Preview] bên dưới khung nhận xét nếu muốn xem trước comment đã viết, trước khi post [đăng]. Tương tự, bấm vào Đăng ký qua email [Subscribe by email] để đăng ký theo dõi nhận xét của bài này.

♦ Các bạn tự chịu trách nhiệm với Nhận xét của mình. Nhận xét để phản hồi, đánh giá, góp ý.... suy nghĩ của bạn. Thông qua Nhận xét hãy để cho mọi người biết Bạn là ai.
Xem ký tự của emoticons khỉ Yoyo tại đây.

^ Scroll to Top