<script>
   if(self!=top){
       top.location=self.location;
   }
   function switchSysBar(){
            if (switchPoint.innerText==3){
         switchPoint.innerText=4
 document.all("frmTitle").style.display="none"
    }else{
                 switchPoint.innerText=3
         document.all("frmTitle").style.display=""
    }
   }
</script>实现的是什么功能?javascriptfunction

解决方案 »

  1.   

    你用的应该是Iframe吧,top是frame的name
      

  2.   

    if(self!=top){
           top.location=self.location;
       }
    //意思是本网页不允许被框架。目的是防止你的网页被引用在别人的页面中!
      

  3.   

    楼上说的对,top指向最顶层框架的window对象,self指向当前框架的window对象。如果网页中没有iframe,则top和self是同一个值,所以这段代码可以防止自己的网页被别人用iframe的方式嵌入到其它网页中去。