请教一个与页面刷新有关的问题!
逍遥散人 2003-08-05 04:48:03 我写了一段代码,作用是定时刷新页面并且在有新数据的情况下播放一个WAV文件,并且用户可以通过一个checkbox手动选择听不听这段WAV。目前,刷新与播放的功能已经完成了,可就是没法把手动选择的功能做上去,现把代码贴上,急求各位高手帮我把选择功能不上,不胜感激!!
<!--#include file="../Inc/Conn.asp"-->
<%
getstr=""
getstrdx=""
chkwav=request("chkwav")
backsound="../music.wav"
sqldx="select * from tabname where bz=0"
set rsdx=Server.CreateObject("ADODB.recordset")
rsdx.Open sqldx,conn,1,3
if rsdx.recordcount=0 then
getstrdx ="暂时没有新信息!"
else
do until rsdx.eof
getstrdx="新信息" & rsdx.recordcount & "条"
rsdx.movenext
loop
if chkwav="wavtrue" then
response.write "<bgsound src=" & backsound & " border=0 loop=1>"
end if
end if
rsdx.close
set rsdx=nothing
%>
<HTML>
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<script language="javascript">
<!--
var limit="0:60"
if (document.images){
var parselimit=limit.split(":")
parselimit=parselimit[0]*60+parselimit[1]*1
}
function beginrefresh()
{
if (!document.images)
return
if (parselimit==1)
{
window.location.reload()
}
else
{
parselimit-=1
curmin=Math.floor(parselimit/60)
cursec=parselimit%60
setTimeout("beginrefresh()",100)
}
}
window.onload=beginrefresh
function chksound()
{
if (document.form1.rachksound.checked==true)
{
document.form1.chkwav.value="wavtrue";
document.form1.rachksound.checked=true;
}
else if (document.form1.rachksound.checked==false)
{
document.form1.chkwav.value="wavfalse";
document.form1.rachksound.checked=false;
}
window.form1.action="";
window.form1.submit();
}
-->
</script>
<base target="_self">
</HEAD>
<BODY topmargin="0" leftmargin="0" link="#FF0000" vlink="#FF0000" alink="#FF0000">
<div align="left">
<table width="907">
<form name="form1">
<tr>
<%
if getstr ="暂时没有新数据!" then
response.write "<td align='center' width='735'>"&getstr&"</td>"
else
%><td align="center">
<marquee scrollamount=2 border=0 scrolldelay=100 onmouseover=this.stop() onmouseout=this.start()><font size="3" color="red"><%=getstr%></font></marquee>
</td>
<%
end if
if getstr ="暂时没有新信息!"then
response.write "<td align='center'>"&getstrdx&"</td>"
else
%><td align="center" width="153">
<font size="2" color="blue"><%=getstrdx%></font>
</td>
<%
end if
%>
<td width="75" align="left">
<input type="checkbox" name="rachksound" onclick="chksound()"><label>开/关声音</label>
</td>
</tr>
<input type="hidden" name="chkwav">
</form>
</table>
</div>
</BODY>
</HTML>