Dim getscore,match_string,id,mess,tevent,i dim leng,theid,themin,thestate,thescore,thehalf,thecard,theevent,haveLoaded dim oldscore,newscore,hostc,guestc,hcard,hcardnum,gcard,gcardnum dim m,j sub loadBaseXml() set loadBase=createobject("microsoft.xmldom") loadBase.async=false loadBase.load("data.xml") set id=loadBase.documentElement.selectNodes("//m/i") set mess=loadBase.documentElement.selectNodes("//m/s")'获得id节点,并且是一个数组 set tevent=loadBase.documentElement.selectNodes("//m/e") leng=id.length-1 RefreshCount=tevent(0).text for i=1 to leng theid=id(i).text match_string=split(mess(i).text,"*") thetime=match_string(0) thestate=match_string(1) thescore=match_string(2) thehalf=match_string(3) hcard=match_string(4) gcard=match_string(5) theevent=tevent(i).text if not document.all.item("matchtime_"&theid) is nothing then if theevent<>"" then document.all.item("eventvalue_"&theid).innerText=theevent document.all.item("event_"&theid).style.display="" end if if thestate<>"" then document.all.item("matchtime_"&theid).matchtime=thetime if thestate="完" or thestate="改" then document.all.item("state_"&theid).innerText=thestate document.all.item("state_"&theid).style.color = "red" else document.all.item("state_"&theid).innerText=thestate end if document.all.item("score_"&theid).innerText=thescore document.all.item("halftime_"&theid).halfScore =thehalf if thestate="半" or thestate="下" or thestate="完" then document.all.item("halftime_"&theid).innerText=thehalf elseif thestate="上" then document.all.item("halftime_"&theid).innerText="" end if if gcard<>"" then document.all.item("guestname_"&theid).innerHTML=document.all.item("guestname_"&theid).thename&"<img src='images/redcard"&cstr(gcard)&".gif'>" end if if hcard<>"" then document.all.item("hostname_"&theid).innerHTML="<img src='images/redcard"&cstr(hcard)&".gif'>"&document.all.item("hostname_"&theid).thename end if '如果已经完场,则移到最下面 if thestate="完" or thestate="改" then moveToEnd(theid) end if end if end if next set loadBase=nothing '开始调用时间计算器 countMatchTime() '开始循环读到即时比分 haveLoaded="yes" loadXml() checkClient()'检查掉线 end sub
function ChooseLeag(mess,n)'按联赛类型来隐藏比赛 if mess="all" then'选择所有的联赛 displayAll() else'选择某个联赛 for i=1 to leftrow.rows.length-2 step 2 'for (i = 1; i < leftRow.rows.length-1; i=i+2){ if document.all.item("matchtype_"&leftRow.rows(i).matchid).innerText=mess then if document.all.item("leagname"&n).checked=false then document.all.item("state_"&leftRow.rows(i).matchid).parentElement.style.display="none" document.all.item("event_"&leftRow.rows(i).matchid).style.display="none" else document.all.item("state_"&leftRow.rows(i).matchid).parentElement.style.display="" if document.all.item("eventvalue_"&leftRow.rows(i).matchid).innerText<>"" then document.all.item("event_"&leftRow.rows(i).matchid).style.display="" end if end if end if next if not document.all.item("rightRow") is nothing then for i=1 to rightrow.rows.length-2 step 2 'for (i = 1; i < rightRow.rows.length-1; i=i+2){ if document.all.item("matchtype_"&rightRow.rows(i).matchid).innerText=mess then if document.all.item("leagname"&n).checked=false then document.all.item("state_"&rightRow.rows(i).matchid).parentElement.style.display="none" document.all.item("event_"&rightRow.rows(i).matchid).style.display="none" else document.all.item("state_"&rightRow.rows(i).matchid).parentElement.style.display="" if document.all.item("eventvalue_"&rightRow.rows(i).matchid).innerText<>"" then document.all.item("event_"&rightRow.rows(i).matchid).style.display="" end if end if end if next end if end if CountHide() end functionsub CountHide() '计算隐藏的比赛数量,然后更换颜色! HideNum=0 j = 1 for m=1 to leftrow.rows.length-2 step 2 if leftRow.rows(m).style.display = "" then j=j+1 if (j-1) mod 2 = 0 then leftRow.rows(m).className = "back3" else leftRow.rows(m).className = "back4" end if elseif leftRow.rows(m).style.display = "none" then HideNum=HideNum+1 end if next j = 1 if not document.all.item("rightRow") is nothing then for n=1 to rightrow.rows.length-2 step 2 if rightRow.rows(n).style.display = "" then j=j+1 if (j- 1) mod 2 = 0 then rightRow.rows(n).className = "back3" else rightRow.rows(n).className = "back4" end if elseif rightRow.rows(n).style.display = "none" then HideNum=HideNum+1 end if next end if hidematchnum.innerText = HideNum end sub sub displayAll()'显示所有隐藏的比赛 for i=1 to leftrow.rows.length-2 step 2 if leftRow.rows(i).style.display = "none" then leftRow.rows(i).style.display="" if document.all.item("eventvalue_"&leftRow.rows(i).matchid).innerText<>"" then document.all.item("event_"&leftRow.rows(i).matchid).style.display="" end if end if next if not document.all.item("rightRow") is nothing then for i=1 to rightrow.rows.length-2 step 2 if rightRow.rows(i).style.display = "none" then rightRow.rows(i).style.display="" if document.all.item("eventvalue_"&rightRow.rows(i).matchid).innerText<>"" then document.all.item("event_"&rightRow.rows(i).matchid).style.display="" end if end if next end if for i=1 to LeagPanel.LeagNum document.all.item("leagname"&i).checked=true next CountHide() end sub function listLeag(mess)'按状态来显示比赛 if mess="all" then'显示所有比赛 displayAll() end if if mess="working" then'显示进行中的比赛;进行中的比赛,状态字不为空 for i=1 to leftrow.rows.length-2 step 2 thestate=document.all.item("state_"&leftRow.rows(i).matchid).innerText if thestate="" or thestate="完" or thestate="改" then document.all.item("state_"&leftRow.rows(i).matchid).parentElement.style.display="none" document.all.item("event_"&leftRow.rows(i).matchid).style.display="none" else document.all.item("state_"&leftRow.rows(i).matchid).parentElement.style.display="" if document.all.item("eventvalue_"&leftRow.rows(i).matchid).innerText<>"" then document.all.item("event_"&leftRow.rows(i).matchid).style.display="" end if end if next if not document.all.item("rightRow") is nothing then for i=1 to rightrow.rows.length-2 step 2 thestate=document.all.item("state_"&rightRow.rows(i).matchid).innerText if thestate="" or thestate="完" or thestate="改" then document.all.item("state_"&rightRow.rows(i).matchid).parentElement.style.display="none" document.all.item("event_"&rightRow.rows(i).matchid).style.display="none" else document.all.item("state_"&rightRow.rows(i).matchid).parentElement.style.display="" if document.all.item("eventvalue_"&rightRow.rows(i).matchid).innerText<>"" then document.all.item("event_"&rightRow.rows(i).matchid).style.display="" end if end if next end if end if if mess="end" then'已经结束的比赛 for i=1 to leftrow.rows.length-2 step 2 matchid=leftRow.rows(i).matchid if document.all.item("state_"&matchid).innerText<>"完" then document.all.item("state_"&matchid).parentElement.style.display="none" document.all.item("event_"&matchid).style.display="none" else document.all.item("state_"&matchid).parentElement.style.display="" if document.all.item("eventvalue_"&matchid).innerText<>"" then document.all.item("event_"&matchid).style.display="" end if end if next if not document.all.item("rightRow") is nothing then for i=1 to rightRow.rows.length-2 step 2 if document.all.item("state_"&rightRow.rows(i).matchid).innerText<>"完" then document.all.item("state_"&rightRow.rows(i).matchid).parentElement.style.display="none" document.all.item("event_"&rightRow.rows(i).matchid).style.display="none" else document.all.item("state_"&rightRow.rows(i).matchid).parentElement.style.display="" if document.all.item("eventvalue_"&rightRow.rows(i).matchid).innerText<>"" then document.all.item("event_"&rightRow.rows(i).matchid).style.display="" end if end if next end if end if if mess="nobegin" then'未开始的比赛 for i=1 to leftRow.rows.length-2 step 2 if document.all.item("state_"&leftRow.rows(i).matchid).innerText<>"" then document.all.item("state_"&leftRow.rows(i).matchid).parentElement.style.display="none" document.all.item("event_"&leftRow.rows(i).matchid).style.display="none" else document.all.item("state_"&leftRow.rows(i).matchid).parentElement.style.display="" if document.all.item("eventvalue_"&leftRow.rows(i).matchid).innerText<>"" then document.all.item("event_"&leftRow.rows(i).matchid).style.display="" end if end if next if not document.all.item("rightRow") is nothing then for i = 1 to rightRow.rows.length-2 step 2 if document.all.item("state_"&rightRow.rows(i).matchid).innerText<>"" then document.all.item("state_"&rightRow.rows(i).matchid).parentElement.style.display="none" document.all.item("event_"&rightRow.rows(i).matchid).style.display="none" else document.all.item("state_"&rightRow.rows(i).matchid).parentElement.style.display="" if document.all.item("eventvalue_"&rightRow.rows(i).matchid).innerText<>"" then document.all.item("event_"&rightRow.rows(i).matchid).style.display="" end if end if next end if end if CountHide() end function
不是在linux下不行,而是在非IE浏览器下不行。。 你把 var poster = new ActiveXObject ("Microsoft.XMLHTTP");换成 if (window.XMLHttpRequest) { poster = new XMLHttpRequest(); } else if (window.ActiveXObject) { poster = new ActiveXObject("Microsoft.XMLHTTP"); }还有 poster.open ("post", "serverTime.php",false)下面加一句 poster.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>编辑课程信息</title>
<script type="text/javascript" src="/{programDir}/js/base64.js"></script>
<script type="text/javascript">
var programDir = "{programDir}";
var address = "/{programDir}/manage.php?class=curriculumManage&method=editCInfo&";
</script>
<script type="text/javascript" src="/{programDir}/js/editInfo.js"></script>
<link href="c/common.css" rel="stylesheet" type="text/css" />
<style type="text/css">
form {
margin:0;
padding:0;
width:0;
height:0;
}
-->
</style>
</head>
<body>
<div>课程管理 >>管理课程{cName}</div>
<form action="" enctype="multipart/form-data" method="post" id="mainform">
<table width="768" height="525" border="1" cellpadding="0" cellspacing="0" bordercolorlight="#CCCCCC" bordercolordark="#FFFFFF">
<caption align="top" id="title">
以下是课程{cName}的信息
</caption>
<tr bgcolor="#006699">
<th width="160" scope="col"><span class="style1">属性</span></th>
<th width="543" scope="col"><span class="style1">值</span></th>
<th width="57" scope="col"><span class="style1">操作</span></th>
</tr>
<tr>
<td width="160"><div align="center">课程编号</div></td>
<td width="543"><div>{CID}</div></td>
<td width="57"><div align="center"> </div></td>
</tr>
<tr>
<td><div align="center">发布日期</div></td>
<td><div>{date}</div></td>
<td><div align="center"> </div></td>
</tr>
<tr>
<td><div align="center">课程名称</div></td>
<td><div id="cName">{cName}</div></td>
<td><div align="center"><a href="#" onclick="showInput('cName');return false;">修改</a></div></td>
</tr>
<tr>
<td><div align="center">教师名称</div></td>
<td><div id="tName">{tName}</div></td>
<td><div align="center"><a href="#" onclick="showInput('tName');return false;">修改</a></div></td>
</tr>
<tr>
<td><div align="center">课程介绍</div></td>
<td><div id="cIntro" class="longtext">{cIntro} </div></td>
<td>
<div align="center"><a href="#" onclick="showInput('cIntro', 'longText');return false;">修改</a>
<script>
cIntro = base64_encode(document.getElementById('cIntro').firstChild.nodeValue);
</script>
</div></td>
</tr>
<tr>
<td><div align="center">教师介绍</div></td>
<td><div id="tIntro" class="longtext">{tIntro} </div></td>
<td>
<div align="center"><a href="#" onclick="showInput('tIntro', 'longText');return false;">修改</a>
<script>
tIntro = base64_encode(document.getElementById('tIntro').firstChild.nodeValue);
</script>
</div></td>
</tr>
<tr>
<td><div align="center">学习方法介绍</div></td>
<td><div id="studyMethod" class="longtext">{studyMethod} </div></td>
<td>
<div align="center"><a href="#" onclick="showInput('studyMethod', 'longText');return false;">修改</a>
<script>
studyMethod = base64_encode(document.getElementById('studyMethod').firstChild.nodeValue);
</script>
</div></td>
</tr>
<tr>
<td><div align="center">指定教材</div></td>
<td><div id="designateBook" class="longtext">{designateBook} </div></td>
<td>
<div align="center"><a href="#" onclick="showInput('designateBook', 'longText');return false;">修改</a>
<script>
designateBook = base64_encode(document.getElementById('designateBook').firstChild.nodeValue);
</script>
</div></td>
</tr>
<tr>
<td><div align="center">教学大纲</div></td>
<td><div id="teachingProgram" class="longtext">{teachingProgram} </div></td>
<td>
<div align="center"><a href="#" onclick="showInput('teachingProgram', 'longText');return false;">修改</a>
<script>
teachingProgram = base64_encode(document.getElementById('teachingProgram').firstChild.nodeValue);
</script>
</div></td>
</tr>
<tr>
<td height="29"><div align="center">教学进度计划</div></td>
<td><div id="teachingSchedule" class="longtext">{teachingSchedule} </div></td>
<td>
<div align="center"><a href="#" onclick="showInput('teachingSchedule', 'longText');return false;">修改</a>
<script>
teachingSchedule = base64_encode(document.getElementById('teachingSchedule').firstChild.nodeValue);
</script>
</div></td>
</tr>
<tr>
<td><div align="center">授课教案</div></td>
<td><div id="teachingPlanFile">{teachingPlanFile}</div></td>
<td><div align="center"><a href="#" onclick="changeFile('teachingPlanFile');return false;">修改</a>
<script>
teachingPlanFile = document.getElementById('teachingPlanFile').firstChild.nodeValue;
displayFile("teachingPlanFile");
</script>
</div></td>
</tr>
<tr>
<td><div align="center">作业习题</div></td>
<td><div id="schoolWorkFile">{schoolWorkFile}</div></td>
<td><div align="center"><a href="#" onclick="changeFile('schoolWorkFile');return false;">修改</a>
<script>
schoolWorkFile = document.getElementById('schoolWorkFile').firstChild.nodeValue;
displayFile("schoolWorkFile");
</script>
</div></td>
</tr>
<tr>
<td><div align="center">实验指导</div></td>
<td><div id="experimentationFile">{experimentationFile}</div></td>
<td><div align="center"><a href="#" onclick="changeFile('experimentationFile');return false;">修改</a>
<script>
experimentationFile = document.getElementById('experimentationFile').firstChild.nodeValue;
displayFile("experimentationFile");
</script>
</div></td>
</tr>
<tr>
<td><div align="center">考核办法</div></td>
<td><div id="examination" class="longtext">{examination} </div></td>
<td>
<div align="center"><a href="#" onclick="showInput('examination', 'longText');return false;">修改</a>
<script>
examination = base64_encode(document.getElementById('examination').firstChild.nodeValue);
</script>
</div></td>
</tr>
<tr>
<td><div align="center">考试试题</div></td>
<td><div id="examinationFile">{examinationFile}</div></td>
<td><div align="center"><a href="#" onclick="changeFile('examinationFile');return false;">修改</a>
<script>
examinationFile = document.getElementById('examinationFile').firstChild.nodeValue;
displayFile("examinationFile");
</script>
</div></td>
</tr>
<tr>
<td><div align="center">参考文献</div></td>
<td><div id="literature" class="longtext">{literature} </div></td>
<td>
<div align="center"><a href="#" onclick="showInput('literature', 'longText');return false;">修改</a>
<script>
literature = base64_encode(document.getElementById('literature').firstChild.nodeValue);
</script></div></td>
</tr>
<tr>
<td><div align="center">授课视频(地址)</div></td>
<td><div id="vedioFile">{vedioFile} </div></td>
<td><div align="center"><a href="#" onclick="showInput('vedioFile');return false;">修改</a></div></td>
</tr>
</table>
</form>
</body>
</html>
base64.js:(本来是用base64编码的,可是太慢了,就用了下面的不过函数名称没有更改)
function base64_decode(string)
{
return decodeURIComponent(string);
}
function base64_encode(string)
{
return encodeURIComponent(string);
}
<?
include "inc/db_sql_class.php";
$db=new db_sql_class();
$db->connect();
?>
<TABLE width='76%' id="leftRow" howrow='l' border=0 align='center' cellPadding=1 cellSpacing=1 bgcolor="#edd3cb">
<TR bgcolor=#000099>
<TD width='10%' ><div align='center'><font color='#FFFFFF' size=2><?=date(m)?>月<?=date(d)?>日</font></div></TD>
<TD width="5%"><div align='center'><font color='#FFFFFF'>隐藏</font></div></TD>
<TD width='5%'><div align='center'><font color='#FFFFFF'>时间</font></div></TD>
<TD width='5%'><div align='center'> <font color='#FFFFFF'>状态</font></div></TD>
<TD width='10%'><div align='center'><font color='#FFFFFF'>主队</font></div></TD>
<TD width='10%'> <div align='center'><font color='#FFFFFF'>比分</font></div></TD>
<TD width='10%'><div align='center'><font color='#FFFFFF'>客队</font></div></TD>
<TD width='10%'><div align="center" class="style1"><font color='#FFFFFF'>半场</font></div></TD>
</TR>
<?
$sql="select mplan.*,a.team_cn as host_cn,b.team_cn as guest_cn,matchtype.color,matchtype.type_cn as matchtype_cn,detail.endtime,detail.halftime,detail.url,detail.tv from mplan inner join detail on detail.matchid=mplan.id inner join matchtype on mplan.typeid=matchtype.id inner join teams as a on a.tid=mplan.hostname inner join teams as b on b.tid=mplan.guestname where mplan.ischoose=1 and mplan.isselect=1 order by mplan.matchtime,matchtype.type_fan";
$db->query($sql);
$count=$db->num_rows();
if($db->num_rows()>0)
{$m=0;
?>
<?
while ($db->next_record())
{?>
<?
$j =$j + 1;
If ($j % 2==0)
$bgcolor = "FFFBE7";
Else
$bgcolor = "F7EBE7";
$matchtype=$db->record["matchtype_cn"];
$hostname=$db->record["host_cn"];
$guestname=$db->record["guest_cn"];
?> <TR id="list_<?=$m?>" matchid="<?=$db->record["id"]?>" matchtype="<?=$matchtype?>" bgcolor="<?=$bgcolor?>" tv="<?=$db->record["tv"]?>" url="<?=$db->record["url"]?>">
<TD height="20" align="center" bgcolor="<?=$db->record["color"]?>" class=matchtype id="matchtype_<?=$db->record["id"]?>"><?=$matchtype?></TD> <TD width="5%" height="20" >
<div align="center">
<INPUT name="checkbox"
type=checkbox id=input_0
onclick="if (!this.checked) {state_<?=$db->record["id"]?>.parentElement.style.display='none'; event_<?=$db->record["id"]?>.style.display='none';this.checked=true;CountHide();}" value=ON CHECKED>
</div></TD>
<TD width="5%" height="20" noWrap id="matchtime_<?=$db->record["id"]?>" matchtime="" num_of_match="<?=$m?>"><?=substr($db->record["matchtime"],11,5)?></TD>
<TD height="20" align="center" id="state_<?=$db->record["id"]?>" style="FONT-WEIGHT: bold; COLOR: black"></TD> <TD height="20" align="right" id="hostname_<?=$db->record["id"]?>" thename="<?=$hostname?>"><?=$hostname?></TD> <TD height="20" align="center"><a href="#" onclick="javascript:showGoalDetail('<?=$db->record["id"]?>');return(false)"><FONT style="FONT-WEIGHT: bold; FONT-FAMILY: verdana;COLOR: black" id=score_<?=$db->record["id"]?> updateTime="0">
<?
if ($db->record["tv"]!="")
echo $db->record["tv"];
else
echo "-";
?>
</FONT></a></TD>
<TD height="20" align="left" id="guestname_<?=$db->record["id"]?>" thename="<?=$guestname?>"><?=$guestname?></TD>
<TD height="20" align="center" id="halftime_<?=$db->record["id"]?>" style="color:red;font-weight: bold;font-family: verdana" halfScore="">
<a href="<?=$db->record["url"]?>" target="_blank"><img src="jw_admin/images/data.gif" width="16" height="16" border="0"></a>
<a href="<?=$db->record["url"]?>" target='_blank'></a> </TD>
</TR>
<TR id="event_<?=$db->record["id"]?>" style="DISPLAY: none">
<TD id="eventvalue_<?=$db->record["id"]?>" bgColor=#ffffff style="color:#0000CC" colSpan=8 align="center"></TD>
</TR> <?
$m=$m+1;
}
}
else echo "今日无直播赛事";
?>
<tr id='l_finish'></tr>
</table>
<script language="JavaScript">
<!--
if (window.Event)
document.captureEvents(Event.MOUSEUP);
function nocontextmenu()
{
event.cancelBubble = true
event.returnValue = false;
return false;
}
function norightclick(e)
{
if (window.Event)
{
if (e.which == 2 || e.which == 3)
return false;
}
else
if (event.button == 2 || event.button == 3)
{
event.cancelBubble = true
event.returnValue = false;
return false;
}
}
document.oncontextmenu = nocontextmenu; // for IE5+
document.onmousedown = norightclick; // for all others
//-->
</script>
<xml id="xml_live"></xml> <xml id="xml_live2"></xml>
<script language="JavaScript">//读到服务器的时间
var poster = new ActiveXObject ("Microsoft.XMLHTTP");
poster.open ("post", "serverTime.php",false)
poster.send()
DDD=poster.responseText.split(" ")
DDDD=DDD[0].split("-")
DDDDD=DDD[1].split(":")
var loaded
recordCount = <?=$count?>
msGetScoreXML = 6000
msShowGoal = 60000
msShowScore = 60000
RefreshCount=0serverNow=new Date(DDDD[0],DDDD[1]-1,DDDD[2],DDDDD[0],DDDDD[1],DDDDD[2])
//serverNow = new Date(2004, 5, 5, 10, 55, 37)
clientNow= new Date()
diffTime = (serverNow -clientNow) / 1000 / 60</script>
<script language="vbscript" src="js/index.vbs"></script>
<SCRIPT language="JavaScript" src="js/inc.js"></SCRIPT>
<SCRIPT LANGUAGE="vbScript">
loadBaseXml()
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
<!--
if (haveLoaded== "yes")
{
window.setTimeout ("Succed()", 1000);
}
else
alert("讀入比分資料時發生錯誤,請刷新一下本頁!!");function Succed()
{
loadTableText.innerHTML = "全部程序及比賽資料已經載入完畢!<br>如果沒有必要請不要刷新本頁<br>Http://www.p8y8.com";
window.setTimeout ("hideLoadMess()", 2000);
}function hideLoadMess()
{
loadTable.style.display = "none";
}//-->
</SCRIPT>
</p>
</BODY></HTML>
dim leng,theid,themin,thestate,thescore,thehalf,thecard,theevent,haveLoaded
dim oldscore,newscore,hostc,guestc,hcard,hcardnum,gcard,gcardnum
dim m,j
sub loadBaseXml()
set loadBase=createobject("microsoft.xmldom")
loadBase.async=false
loadBase.load("data.xml")
set id=loadBase.documentElement.selectNodes("//m/i")
set mess=loadBase.documentElement.selectNodes("//m/s")'获得id节点,并且是一个数组
set tevent=loadBase.documentElement.selectNodes("//m/e")
leng=id.length-1
RefreshCount=tevent(0).text for i=1 to leng
theid=id(i).text
match_string=split(mess(i).text,"*")
thetime=match_string(0)
thestate=match_string(1)
thescore=match_string(2)
thehalf=match_string(3)
hcard=match_string(4)
gcard=match_string(5)
theevent=tevent(i).text
if not document.all.item("matchtime_"&theid) is nothing then
if theevent<>"" then
document.all.item("eventvalue_"&theid).innerText=theevent
document.all.item("event_"&theid).style.display=""
end if
if thestate<>"" then
document.all.item("matchtime_"&theid).matchtime=thetime
if thestate="完" or thestate="改" then
document.all.item("state_"&theid).innerText=thestate
document.all.item("state_"&theid).style.color = "red"
else
document.all.item("state_"&theid).innerText=thestate
end if
document.all.item("score_"&theid).innerText=thescore
document.all.item("halftime_"&theid).halfScore =thehalf
if thestate="半" or thestate="下" or thestate="完" then
document.all.item("halftime_"&theid).innerText=thehalf
elseif thestate="上" then
document.all.item("halftime_"&theid).innerText=""
end if
if gcard<>"" then
document.all.item("guestname_"&theid).innerHTML=document.all.item("guestname_"&theid).thename&"<img src='images/redcard"&cstr(gcard)&".gif'>"
end if
if hcard<>"" then
document.all.item("hostname_"&theid).innerHTML="<img src='images/redcard"&cstr(hcard)&".gif'>"&document.all.item("hostname_"&theid).thename
end if
'如果已经完场,则移到最下面
if thestate="完" or thestate="改" then
moveToEnd(theid)
end if
end if
end if
next
set loadBase=nothing
'开始调用时间计算器
countMatchTime()
'开始循环读到即时比分
haveLoaded="yes"
loadXml()
checkClient()'检查掉线
end sub
if mess="all" then'选择所有的联赛
displayAll()
else'选择某个联赛
for i=1 to leftrow.rows.length-2 step 2
'for (i = 1; i < leftRow.rows.length-1; i=i+2){
if document.all.item("matchtype_"&leftRow.rows(i).matchid).innerText=mess then
if document.all.item("leagname"&n).checked=false then
document.all.item("state_"&leftRow.rows(i).matchid).parentElement.style.display="none"
document.all.item("event_"&leftRow.rows(i).matchid).style.display="none"
else
document.all.item("state_"&leftRow.rows(i).matchid).parentElement.style.display=""
if document.all.item("eventvalue_"&leftRow.rows(i).matchid).innerText<>"" then
document.all.item("event_"&leftRow.rows(i).matchid).style.display=""
end if
end if
end if
next
if not document.all.item("rightRow") is nothing then
for i=1 to rightrow.rows.length-2 step 2
'for (i = 1; i < rightRow.rows.length-1; i=i+2){
if document.all.item("matchtype_"&rightRow.rows(i).matchid).innerText=mess then
if document.all.item("leagname"&n).checked=false then
document.all.item("state_"&rightRow.rows(i).matchid).parentElement.style.display="none"
document.all.item("event_"&rightRow.rows(i).matchid).style.display="none"
else
document.all.item("state_"&rightRow.rows(i).matchid).parentElement.style.display=""
if document.all.item("eventvalue_"&rightRow.rows(i).matchid).innerText<>"" then
document.all.item("event_"&rightRow.rows(i).matchid).style.display=""
end if
end if
end if
next
end if end if
CountHide()
end functionsub CountHide() '计算隐藏的比赛数量,然后更换颜色!
HideNum=0
j = 1
for m=1 to leftrow.rows.length-2 step 2
if leftRow.rows(m).style.display = "" then
j=j+1
if (j-1) mod 2 = 0 then
leftRow.rows(m).className = "back3"
else
leftRow.rows(m).className = "back4"
end if
elseif leftRow.rows(m).style.display = "none" then
HideNum=HideNum+1
end if
next
j = 1
if not document.all.item("rightRow") is nothing then
for n=1 to rightrow.rows.length-2 step 2
if rightRow.rows(n).style.display = "" then
j=j+1
if (j- 1) mod 2 = 0 then
rightRow.rows(n).className = "back3"
else
rightRow.rows(n).className = "back4"
end if
elseif rightRow.rows(n).style.display = "none" then
HideNum=HideNum+1
end if
next
end if
hidematchnum.innerText = HideNum
end sub
sub displayAll()'显示所有隐藏的比赛
for i=1 to leftrow.rows.length-2 step 2
if leftRow.rows(i).style.display = "none" then
leftRow.rows(i).style.display=""
if document.all.item("eventvalue_"&leftRow.rows(i).matchid).innerText<>"" then
document.all.item("event_"&leftRow.rows(i).matchid).style.display=""
end if
end if
next
if not document.all.item("rightRow") is nothing then
for i=1 to rightrow.rows.length-2 step 2
if rightRow.rows(i).style.display = "none" then
rightRow.rows(i).style.display=""
if document.all.item("eventvalue_"&rightRow.rows(i).matchid).innerText<>"" then
document.all.item("event_"&rightRow.rows(i).matchid).style.display=""
end if
end if
next
end if
for i=1 to LeagPanel.LeagNum
document.all.item("leagname"&i).checked=true
next
CountHide()
end sub
function listLeag(mess)'按状态来显示比赛
if mess="all" then'显示所有比赛
displayAll()
end if
if mess="working" then'显示进行中的比赛;进行中的比赛,状态字不为空
for i=1 to leftrow.rows.length-2 step 2
thestate=document.all.item("state_"&leftRow.rows(i).matchid).innerText
if thestate="" or thestate="完" or thestate="改" then
document.all.item("state_"&leftRow.rows(i).matchid).parentElement.style.display="none"
document.all.item("event_"&leftRow.rows(i).matchid).style.display="none"
else
document.all.item("state_"&leftRow.rows(i).matchid).parentElement.style.display=""
if document.all.item("eventvalue_"&leftRow.rows(i).matchid).innerText<>"" then
document.all.item("event_"&leftRow.rows(i).matchid).style.display=""
end if
end if
next
if not document.all.item("rightRow") is nothing then
for i=1 to rightrow.rows.length-2 step 2
thestate=document.all.item("state_"&rightRow.rows(i).matchid).innerText
if thestate="" or thestate="完" or thestate="改" then
document.all.item("state_"&rightRow.rows(i).matchid).parentElement.style.display="none"
document.all.item("event_"&rightRow.rows(i).matchid).style.display="none"
else
document.all.item("state_"&rightRow.rows(i).matchid).parentElement.style.display=""
if document.all.item("eventvalue_"&rightRow.rows(i).matchid).innerText<>"" then
document.all.item("event_"&rightRow.rows(i).matchid).style.display=""
end if
end if
next
end if
end if
if mess="end" then'已经结束的比赛
for i=1 to leftrow.rows.length-2 step 2
matchid=leftRow.rows(i).matchid
if document.all.item("state_"&matchid).innerText<>"完" then
document.all.item("state_"&matchid).parentElement.style.display="none"
document.all.item("event_"&matchid).style.display="none"
else
document.all.item("state_"&matchid).parentElement.style.display=""
if document.all.item("eventvalue_"&matchid).innerText<>"" then
document.all.item("event_"&matchid).style.display=""
end if
end if
next
if not document.all.item("rightRow") is nothing then
for i=1 to rightRow.rows.length-2 step 2
if document.all.item("state_"&rightRow.rows(i).matchid).innerText<>"完" then
document.all.item("state_"&rightRow.rows(i).matchid).parentElement.style.display="none"
document.all.item("event_"&rightRow.rows(i).matchid).style.display="none"
else
document.all.item("state_"&rightRow.rows(i).matchid).parentElement.style.display=""
if document.all.item("eventvalue_"&rightRow.rows(i).matchid).innerText<>"" then
document.all.item("event_"&rightRow.rows(i).matchid).style.display=""
end if
end if
next
end if
end if
if mess="nobegin" then'未开始的比赛
for i=1 to leftRow.rows.length-2 step 2
if document.all.item("state_"&leftRow.rows(i).matchid).innerText<>"" then
document.all.item("state_"&leftRow.rows(i).matchid).parentElement.style.display="none"
document.all.item("event_"&leftRow.rows(i).matchid).style.display="none"
else
document.all.item("state_"&leftRow.rows(i).matchid).parentElement.style.display=""
if document.all.item("eventvalue_"&leftRow.rows(i).matchid).innerText<>"" then
document.all.item("event_"&leftRow.rows(i).matchid).style.display=""
end if
end if
next
if not document.all.item("rightRow") is nothing then
for i = 1 to rightRow.rows.length-2 step 2
if document.all.item("state_"&rightRow.rows(i).matchid).innerText<>"" then
document.all.item("state_"&rightRow.rows(i).matchid).parentElement.style.display="none"
document.all.item("event_"&rightRow.rows(i).matchid).style.display="none"
else
document.all.item("state_"&rightRow.rows(i).matchid).parentElement.style.display=""
if document.all.item("eventvalue_"&rightRow.rows(i).matchid).innerText<>"" then
document.all.item("event_"&rightRow.rows(i).matchid).style.display=""
end if
end if
next
end if
end if
CountHide()
end function
如果需要的话我可以给你相关的文件
钱就不必了 哈哈
用xmlhttp也可以啊,(clint)
QQ346767073
楼上哪位代码发给我,观摩一下。[email protected]楼主啊,忌讳贴长篇代码的。你让别人怎么看呢。
如果你要做在线直播,那么你可以参考下sina的在线直播系统,将其优化调整一下,就非常合适
前台完全动态,后台自由控制,他的那种方式要优于聊天室所采用的xmlhttp无刷新,更适合做在线直播的东西代码这样贴,乱了些。
script language="JavaScript">//读到服务器的时间
var poster = new ActiveXObject ("Microsoft.XMLHTTP");
poster.open ("post", "serverTime.php",false)
poster.send()
DDD=poster.responseText.split(" ")
DDDD=DDD[0].split("-")
DDDDD=DDD[1].split(":")
var loaded
recordCount = <?=$count?>
msGetScoreXML = 6000
msShowGoal = 60000
msShowScore = 60000
RefreshCount=0serverNow=new Date(DDDD[0],DDDD[1]-1,DDDD[2],DDDDD[0],DDDDD[1],DDDDD[2])
//serverNow = new Date(2004, 5, 5, 10, 55, 37)
clientNow= new Date()
diffTime = (serverNow -clientNow) / 1000 / 60</script>
请问如何替换Microsoft.XMLHTTP
你把
var poster = new ActiveXObject ("Microsoft.XMLHTTP");换成
if (window.XMLHttpRequest) {
poster = new XMLHttpRequest();
} else if (window.ActiveXObject) {
poster = new ActiveXObject("Microsoft.XMLHTTP");
}还有
poster.open ("post", "serverTime.php",false)下面加一句
poster.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
楼上哪位代码发给我,观摩一下。[email protected]楼主啊,忌讳贴长篇代码的。你让别人怎么看呢。
<?xml version="1.0" encoding="GBK"?>
<list><m><i>8</i><s>2000</s><e/></m><m><i>94</i><s>2005,09,12,12,12*上*4-3*-**</s><e></e></m><m><i>92</i><s>2005,09,12,12,12*上*5-5*-**</s><e/></m><m><i>90</i><s>2005,09,12,12,12*上*2-5*-**</s><e/></m><m><i>95</i><s>2005,09,12,12,12*上*2-1*-**</s><e/></m><m><i>93</i><s>2005,09,12,12,12*上*6-7*-**</s><e/></m><m><i>91</i><s>2005,09,12,12,12*上*3-2*-**</s><e/></m><m><i>97</i><s>2005,09,12,12,13*上*3-1*-**</s><e/></m><m><i>96</i><s>2005,09,12,12,13*上*1-1*-**</s><e/></m></list>
我要修改的是:用<i></i>里面数据找到当前记录
修改<s></s>和<e></e>里面的数据