不用禁止iframe,把这段代码加到文件中即可.
<script>
if( top.window.location.href != window.location.href )
{
    top.window.location.href = window.location.href 
}</script>

解决方案 »

  1.   

    <SCRIPT LANGUAGE=javascript><!-- 
    if (top.location != self.location)top.location=self.location;
    // --></SCRIPT>
      

  2.   

    <script language='javascript'>
    if (top!= self)top.location=self.location;
    </script>
      

  3.   

    楼上几位的用法禁止了别人将你的页面作为frame但是也禁止了你自己将这个页面作为frame(iframe),也许不是你想要的结果,你可以考虑检查http头,看它的referer是否在你的域中。
      

  4.   

    朋友们,还是不行啊,还是会被别人IFRAME,我就想禁止在网页中使用 FRAME,IFRAME这些东西,反正我不用它,这样别人就没办法了啊
      

  5.   

    真的啊,我都试过的,隔一天就被别人IFRAME,我想的是禁止在我的网页使用FRAME或IFRAME(包括我自己都不用FRAME)不知道可不可以禁止