张碧晨红玫瑰mp3微盘:ASP高手请进关于生成HTML进度条?

来源:百度文库 编辑:高校问答 时间:2024/05/05 19:54:29
<%
Response.Write "<br><br><br><br><br><div align=""center""> " & vbCrLf'代码开始
Response.Write "<table width=""200"" border=""0"" cellspacing=""1"" cellpadding=""1"">" & vbCrLf
Response.Write "<tr> " & vbCrLf
Response.Write "<td bgcolor=000000>" & vbCrLf
Response.Write " <table width=""200"" border=""0"" cellspacing=""0"" cellpadding=""1"">" & vbCrLf
Response.Write "<tr> " & vbCrLf
Response.Write "<td bgcolor=ffffff height=9><img src=""images/bar9.gif"" width=0 height=16 id=img2 name=img2 align=absmiddle></td></tr></table>" & vbCrLf
Response.Write "</td></tr></table></td></tr><tr> " & vbCrLf
Response.Write "<td align=center bgcolor=000000> <span id=txt2 name=txt2 style=""font-size:9pt"">0</span><span style=""font-size:9pt"">%</span> <span id=txt3 name=txt3 style=""font-size:9pt"">0</span></td></tr>" & vbCrLf
Response.Write "</table>" & vbCrLf
Response.Write "</div> " & vbCrLf
Response.Flush

i=0
w=rsn.recordcount'得到记录集总数
Do While Not rsn.EOF
info_id = rsn("productid")
makehtml_info(productid)'注意这里函数makehtml_info(info_id)也跟着循环
i=i+1'得到现时完成数
Response.Write "<script>img2.width=" & Fix((i / w) * 200) & ";" & vbCrLf'Fix函数,截尾取整,不四舍五入
Response.Write "txt2.innerHTML=""生成进度:" & FormatNumber(i / w * 100, 4, -1) & """;" & vbCrLf
Response.Write "txt3.innerHTML=""共有 <B><font color=RED>" & w & "</font></B> 个 正在生成第 " & i & " 个"";" & vbCrLf
Response.Write "img2.title=""(" & i & ")"";</script>" & vbCrLf
Response.Flush
rsn.movenext

Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsn.MoveNext()
loop
Wend
%>
上面这段进度条只能生成一条,,请望高手指点

<script language=VBScript>
Dim Bar, Line, SP
Bar = 0
Line = "|"
SP = 100

Function Window_onLoad()
Bar = 95
SP = 10
End Function

Function Count()
If Bar < 100 Then
Bar = Bar + 1
Window.Status = "已成功下载" & Bar & "%" & " " & String(Bar, Line)
setTimeout "Count()", SP
Else
Window.Status = "欢迎你的光临!!!"
Document.Body.Style.Display = ""
End If
End Function

Call Count()
</script>

info_id = rsn("productid")
makehtml_info(productid)'注意这里函数makehtml_info(info_id)也跟着循环
这里看你代码写的是什么???
而你上面那一块代码又是在什么来的???是不是makeHTML_info函数里的??

因为你只定义了一行的img2,txt2,txt3
如果要求得到多行进度条输出,定义的3个id对象的组数应该和你的进度条数相同。
如果看的没错应该是在loop和wend之间加入其他数据库读取进度的do while循环。

"&<>€ ÁáÂâ

只能生成一条??那你要生成多少条??

应该运行之后,会有JS错误吧。。