查看它有没有parent吧?有就是FRAM,没有就是HTML PAGE吧

解决方案 »

  1.   

    if (top != self) {}
      

  2.   

    if (top.location != self.location){}
      

  3.   

    if (top != self) {}
    if (top.location != self.location){}
    可以用来判断帧结构的吧那么怎么区分是在帧结构里面、还是在iframe里面呢?
      

  4.   

    对呀,我就是要处理只是在Frame里,而不在iframe里的情况.
      

  5.   

    我知道了 http://www.irt.org/script/54.htmQ54 How can I tell whether the document is loaded within frames?if (parent.frames.length != 0) {
      // loaded in frames
    }
    else {
      // not loaded frames
    }
     
      

  6.   

    不行啊,还是区分不了frame还是iframe
      

  7.   

    if (top != self) {
    if(window.frameElement.tagName=="IFRAME")
    {
    alert('in iframe');
    }
    else
    {
    alert('in frame');
    }}
      

  8.   

    奇怪我给ttyp分了,这里怎么没显示出来啊