在被 frame 的网页<head>区是加入
<script language="Javascript"><!--
  if ((window==top)||(top.location.href!=body))
  top.location.href=='你的框架网页名URL'; //这个网页永远都会背着框架
// --></script>
<base target=body>另:强烈建议不要用body这样的关键词作为帧名。

解决方案 »

  1.   

    不好意思,上面这段代码我要更正在<head>区是加入<script language="Javascript"><!--
    if (window==top) //******************************
    top.location.href=='你的框架网页名'; //这个网页永远都会拖着这个框架
    // --></script>
    <base target=body>另:强烈建议不要用body这样的关键词作为帧名。
      

  2.   

    用iframe做个测试:<iframe src=a.htm name=body></iframe>a.htm文件:
    <script language=javascript>
    var str="";
    try{
    if(top.body.location.href==this.location.href) alert("It's in OK");
    else alert("File not in body!");
    }catch(e){
      alert(e.description);
    }
    </script>
      

  3.   

    多谢了,还要请教哪我怎么样来检查被命名为body的frame是存在的??
      

  4.   

    if(top.body)alert("存在");
    else alert("No");