if(window.frames.length==0) {
     can't
} else {
     can
}

解决方案 »

  1.   

    我是想再每一个Frame页中测试,但是提示都没有正确打开
      

  2.   

    say your 框架页 is "frame.html", the two frames are a.html and b.html, add this code inside your a.html and b.html:<script language="javascript">  var bLoadTop = true;  if (top != self)
      {
         if (top.location.href.indexOf("/frame.html") >0)
               bLoadTop = false;
      }  if (bLoadTop)
       top.location.href="frame.html"; 
    </script>
      

  3.   

    谢谢 karma(无为)
    同时也谢谢 sdtashenjie(sdtashenjie)