日期:2014-05-16  浏览次数:20404 次

这段代码什么意思top.location=self.location;

<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>

实现的是什么功能?
javascript function

------解决方案--------------------
你用的应该是Iframe吧,top是frame的name
------解决方案--------------------
if(self!=top){
       top.location=self.location;
   }
//意思是本网页不允许被框架。目的是防止你的网页被引用在别人的页面中!