蒲地蓝颗粒:如何解释这段代码??

来源:百度文库 编辑:高校问答 时间:2024/05/02 15:51:30
<script language="javascript1.2">
showTime=30;
showChance=1;
var toid;
var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);
showCount=0;
function initShow(){
if(!ns && !ie && !w3) return;
if(ie) showStyle=eval('document.all.show.style');
else if(ns) showStyle=eval('document.layers["show"]');
else if(w3) showStyle=eval('document.getElementById("show").style');
randAd=Math.ceil(Math.random()*showChance);
if (ie||w3)
showStyle.visibility="visible";
else
showStyle.visibility ="show";
if(randAd==1) toShow();
}
function initLogin(){
if(!ns && !ie && !w3) return;
if(ie) loginStyle=eval('document.all.login.style');
else if(ns) loginStyle=eval('document.layers["login"]');
else if(w3) loginStyle=eval('document.getElementById("login").style');
if (ie||w3)
loginStyle.visibility="visible";
else
loginStyle.visibility ="show";
toLogin();
}
function toShow(){
if(showCount<showTime*10){showCount+=1;
if (ie){documentWidth = document.body.offsetWidth/2+document.body.scrollLeft-20;
documentHeight =document.body.offsetHeight/2+document.body.scrollTop-20;}
else if (ns){documentWidth=window.innerWidth/2+window.pageXOffset-20;
documentHeight=window.innerHeight/2+window.pageYOffset-20;}
else if (w3){documentWidth=self.innerWidth/2+window.pageXOffset-20;
documentHeight=self.innerHeight/2+window.pageYOffset-20;}
showStyle.left=documentWidth-250;showStyle.top =documentHeight-135;
toid = setTimeout("toShow()",100);}else closeShow();
}
function toLogin(){

if (ie){documentWidth = document.body.offsetWidth/2+document.body.scrollLeft-20;
documentHeight =document.body.offsetHeight/2+document.body.scrollTop-20;}
else if (ns){documentWidth=window.innerWidth/2+window.pageXOffset-20;
documentHeight=window.innerHeight/2+window.pageYOffset-20;}
else if (w3){documentWidth=self.innerWidth/2+window.pageXOffset-20;
documentHeight=self.innerHeight/2+window.pageYOffset-20;}
loginStyle.left=documentWidth-250;loginStyle.top =documentHeight-135;
//setTimeout("toLogin()",100);
}

function closeShow(){
if (ie||w3)
{
showStyle.display="none";
}
else
{
showStyle.visibility ="hide";
}
}
function judgeLogin(){
if (hp.isHomePage('http://www.qq.com/'))
{
initLogin();
}
}
function closeLogin(){
if (ie||w3)
{
loginStyle.display="none";
}
else
{
loginStyle.visibility ="hide";
}
}
function check(){
//if (isValue.checked == true)
//{
clearTimeout(toid);
hp.setHomePage('http://www.qq.com/');
closeShow();
judgeLogin();
//}
//closeShow();
}
</script>

if (hp.isHomePage('http://www.qq.com/';))

hp.setHomePage('http://www.qq.com/';);

这两行把前面的;去掉

太多了