
asp 投票代码的问题
<%dimc(20)dimd(20)dimd2(20)Setfs=CreateObject("Scripting.FileSystemObject")Seta=fs.op...
<%
dim c(20)
dim d(20)
dim d2(20)
Set fs=CreateObject("Scripting.FileSystemObject")
Set a=fs.openTextFile(server.mappath("tp.txt"))
tpcount=cint(a.readline)
for i=0 to tpcount-1
c(i)=a.readline
d(i)=a.readline
next
all=0
for i=0 to tpcount-1
all=all+d(i)
next
for i=0 to tpcount-1
t=t+d(i)
next
if t>0 then
for i=0 to tpcount-1
d2(i)=formatpercent((d(i)/all),2,-1)
next
disptp=100
else
for i=0 to tpcount-1
d2(i)=formatpercent((0),2,-1)
next
disptp=0
end if
response.write "document.write("&chr(34)&"<table width=220 border=1 height=55 bordercolor=#0000FF cellspacing=0>"&chr(34)&");"
response.write "document.write("&chr(34)&"<tr><td width=80 height=26>参赛人</td> <td width=80 height=26>票数</td><td width=60 height=26>投票率</td></tr>"&chr(34)&");"
for i=0 to tpcount-1
response.write "document.write("&chr(34)&"<tr><td width=80 height=24>"&c(i)&"</td><td width=80 height=24>"&d(i)&"</td><td width=60 height=24>"&d2(i)&" </td></tr>"&chr(34)&");"
next
response.write "document.write("&chr(34)&"<tr><td width=80 height=26> </td> <td width=80 height=26>"&all&"</td><td width=60 height=26>"&disptp&"% </td></tr></table>"&chr(34)&");"
response.write "document.write("&chr(34)&"<form method=post action=tp.asp>我认为<select name=name>"&chr(34)&");"
for i=0 to tpcount-1
response.write "document.write("&chr(34)&"<option value="&c(i)&">"&c(i)&"</option>"&chr(34)&");"
next
response.write "document.write("&chr(34)&"</select>的故事写得比较好。<br><input type=submit name=send value=投票></form>"&chr(34)&");"
%>
这段代码怎么会显示出
document.write("
");document.write("
");document.write("
");document.write("
");document.write("
这些代码来了... 展开
dim c(20)
dim d(20)
dim d2(20)
Set fs=CreateObject("Scripting.FileSystemObject")
Set a=fs.openTextFile(server.mappath("tp.txt"))
tpcount=cint(a.readline)
for i=0 to tpcount-1
c(i)=a.readline
d(i)=a.readline
next
all=0
for i=0 to tpcount-1
all=all+d(i)
next
for i=0 to tpcount-1
t=t+d(i)
next
if t>0 then
for i=0 to tpcount-1
d2(i)=formatpercent((d(i)/all),2,-1)
next
disptp=100
else
for i=0 to tpcount-1
d2(i)=formatpercent((0),2,-1)
next
disptp=0
end if
response.write "document.write("&chr(34)&"<table width=220 border=1 height=55 bordercolor=#0000FF cellspacing=0>"&chr(34)&");"
response.write "document.write("&chr(34)&"<tr><td width=80 height=26>参赛人</td> <td width=80 height=26>票数</td><td width=60 height=26>投票率</td></tr>"&chr(34)&");"
for i=0 to tpcount-1
response.write "document.write("&chr(34)&"<tr><td width=80 height=24>"&c(i)&"</td><td width=80 height=24>"&d(i)&"</td><td width=60 height=24>"&d2(i)&" </td></tr>"&chr(34)&");"
next
response.write "document.write("&chr(34)&"<tr><td width=80 height=26> </td> <td width=80 height=26>"&all&"</td><td width=60 height=26>"&disptp&"% </td></tr></table>"&chr(34)&");"
response.write "document.write("&chr(34)&"<form method=post action=tp.asp>我认为<select name=name>"&chr(34)&");"
for i=0 to tpcount-1
response.write "document.write("&chr(34)&"<option value="&c(i)&">"&c(i)&"</option>"&chr(34)&");"
next
response.write "document.write("&chr(34)&"</select>的故事写得比较好。<br><input type=submit name=send value=投票></form>"&chr(34)&");"
%>
这段代码怎么会显示出
document.write("
");document.write("
");document.write("
");document.write("
");document.write("
这些代码来了... 展开
展开全部
楼上的朋友,既然没有能力帮别人解决问题就不要说大话..
ASP就一定比JSP差吗??什么狗屁逻辑
其实输出下面这一个是方便JS调用
document.write("
");document.write("
");document.write("
");document.write("
");document.write("
你把上面的程序保存为youfilename.asp
然后用JS调用就不会出理这种情况了
<script language="JavaScript" src="youfilename.asp" type="text/JavaScript"></script>
ASP就一定比JSP差吗??什么狗屁逻辑
其实输出下面这一个是方便JS调用
document.write("
");document.write("
");document.write("
");document.write("
");document.write("
你把上面的程序保存为youfilename.asp
然后用JS调用就不会出理这种情况了
<script language="JavaScript" src="youfilename.asp" type="text/JavaScript"></script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询