首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

这段代码什么意思top.location=self.location;该如何处理

2013-02-02 
这段代码什么意思top.locationself.locationscriptif(self!top){top.locationself.location}functi

这段代码什么意思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;
   }
//意思是本网页不允许被框架。目的是防止你的网页被引用在别人的页面中!

热点排行