1、我的页面生成html静态页,有关评论的语句用<script src="/Include/getReview.asp"></script>表示,以保证这一部内空是动态显示,为什么没有任何内容显示啊??是不是我的getReview.asp代码有错?浏览器没有任何提示啊2、在同一html页面还有一行<script src="/Include/getHits.asp"></script> ,统计本页面点击量的内容就是OK的啊
3、'-----------------------getReview.asp内容开始--------------------------
<%
dim review_page_num
review_page_num=Format_Mid_Num(27)
function review_type()
dim rtid,rtt,ruser,rturl,rtit,ChannelIDs,RScore
ChannelIDs=11
rtid=10
rturl="/Music/Music_singer.asp?action=singerlist&n_id=10"
rtt=1
ruser="suntech2000"
RScore=""
rtit="网络歌手" dim isadmin,rsr,sqlr,rusername,remail,rtype,rtim,retim,rword,reword,rrssum,tmp_review,reip,readonly
isadmin=false
if int(login_modep)=1 or int(login_modep)=2 then isadmin=true
if rtt=0 and ruser=login_username then isadmin=true
rrssum=0
sqlr="select count(rid) from AsaiMHReview where ChannelIDs="&ChannelIDs&" and re_id="&rtid
set rsr=Cls.exec(sqlr,1)
if not rsr.eof then
rrssum=rsr(0)
End If
dim rRScore,rtscore
rtscore=cls.getreview(ChannelIDs,rtid,"")
tmp_review=tmp_review&"<table cellspacing=1 cellpadding=4 class=rv_table>" & _
vbcrlf&"<tr><td class=rv_trt height=20>"
if rrssum=0 then
tmp_review=tmp_review&" 目前尚无评论,总评价 <font class=red>"&rtscore&"</font> 分"
else
tmp_review=tmp_review&" <a href='javascript:;' onclick=""javascript:open_win('"&Cls.Web_Dir&"Common/Review.asp?action=list&ChannelIDs="&ChannelIDs&" &re_id="&rtid&"&rtit="&server.urlencode(rtit)&"&ruser="&server.urlencode(ruser)&"','review_list',500,400,'yes');"">有 <font class=red>"&rrssum&"</font> 位网友参加了评论和打分</a>" & _
vbcrlf&" 共计 <font class=red>"&rtscore&"</font> 分"
end if
if int(login_modep)=1 or int(login_modep)=2 then
tmp_review=tmp_review&" <a href='"&Cls.Web_Dir&"Common/Review.asp?action=delete&ChannelIDs="&ChannelIDs&"&re_id="&rtid&"&rurl="&server.urlencode(rturl)&"' onclick=""javascript:return click_return('删除本文的所有评论内容',0);"">删除本文所有评论</a>"
End If
tmp_review=tmp_review&"</td></tr>"
sqlr="select top "&review_page_num&" rid,rusername,remail,rword,rtim,rtype,retim,reword,rip,RScore from AsaiMHReview where ChannelIDs="&ChannelIDs&" and re_id="&rtid&" order by rid desc"
set rsr=Cls.exec(sqlr,1)
do while not rsr.eof
rusername=rsr("rusername")
remail=rsr("remail")
rtype=rsr("rtype")
rtim=rsr("rtim")
retim=rsr("retim")
'rword=rsr("rword")
rword=Ubb.Ubbcode(rsr("rword"))
rword=Replace(rword,"<br />","")
'reword=rsr("reword")
reword=Ubb.Ubbcode(rsr("reword"))
reword=Replace(reword,"<br />","")
rRScore=rsr("RScore")
reip=ip_types(rsr("rip"))
if Cls.Is_Null(remail)<>"" then remail="<a href='mailto:"&remail&"'><img src='"&Cls.web_skindir&"small/email.gif' border=0 align=absmiddle title='"&rusername&" 的电子邮件:"&remail&"'></a>"
if rtype=1 then rusername=format_user_name(rusername,0,"")
rtim="<font class=tims>"&Cls.time_type(rtim,1)&"</font>"
tmp_review=tmp_review&"<tr class=rv_tr><td>" & _
vbcrlf&"<table border=0 cellspacing=1 cellpadding=4 width='100%' class=tf>" & _
vbcrlf&"<tr><td>"&img_skin("h_review")&" 网友 "&rusername&" 评[ <font class=red>"&rRScore&"</font> 分] <font class=Gys>["&reip&"] </font>"
tmp_review=tmp_review&"</td><td align=right>"&remail
if login_username=ruser and login_mode<>"" or isadmin then
tmp_review=tmp_review&" "&review_page(Cls.Web_Dir&"Common/Review.asp?action=reply&ChannelIDs="&ChannelIDs&" &re_id="&rtid&"&rid="&rsr("rid")&"&rurl="&server.urlencode(rturl)&"&rtit="&server.urlencode(rtit))
End If
if isadmin then
tmp_review=tmp_review&" <a href='"&Cls.Web_Dir&"Common/Review.asp?action=del&ChannelIDs="&ChannelIDs&"&re_id="&rtid&"&rid="&rsr("rid")&"&rurl="&server.urlencode(rturl)&"' onclick=""javascript:return click_return('删除这条评论内容',0);""><img src='"&Cls.web_skindir&"small/del.gif' border=0 align=absmiddle title='删除这条评论'></a>"
End If
tmp_review=tmp_review&" "&rtim&"</td></tr>" & _
vbcrlf&"<tr><td colspan=2><font class=blue><b>评:</b></font>"&Cls.code_html(rword,2,0)&"</td></tr>"
if Cls.Is_Null(reword)<>"" then
tmp_review=tmp_review&"<tr><td colspan=2><font class=red2><b>回:</b></font>"&Cls.code_html(reword,2,0)&"</td></tr>"
End If
tmp_review=tmp_review&"</table></td></tr>"
tmp_review=tmp_review&"<tr class=rv_trline><td></td></tr>"
rsr.movenext
loop
rsr.close
set rsr=nothing
readonly=""
if login_mode<>"" then readonly="readonly"
if int(format_mid_num(40))=1 and login_mode="" then
tmp_review=tmp_review& vbcrlf&"<tr class=rv_trb><td align=center height=20>发表评论请先 <a href='"&Cls.Web_Dir&"User/Register.asp'>注册</a> 或 <a href='"&Cls.Web_Dir&"User/Login.asp?old_url=back'>登陆</a> 本站!</td></tr></table>"
else
tmp_review=tmp_review&"<tr class=rv_trb><td align=center><table border=0 cellspacing=1 cellpadding=4 width='100%'><tr align=left><td width='100%'><table border=0 cellspacing=0 cellpadding=2><form name=review_frm action='"&Cls.Web_Dir&"Common/Review.asp?ChannelIDs="&ChannelIDs&"&re_id="&rtid&"&ruser="&ruser&"&rurl="&server.urlencode(rturl)&"' method=post onsubmit=""javascript:frm_submitonce(this);""><tr height=30><td>我来评分:<td><input type=radio name=RScore checked value='1'> 1分 <input type=radio name=RScore value='2'> 2分 <input type=radio name=RScore value='3'> 3分 <input type=radio name=RScore value='4'> 4分 <input type=radio name=RScore value='5'> 5分</td></tr><tr><td>您的姓名:</td><td><input type=text class=txt name=rusername value='"&login_username&"' size=25 maxlength=20 "&readonly&"> "&redx&"</td></tr><tr><td>电子邮箱:</td><td><input type=text class=txt name=remail value='"&login_email&"' size=25 id=0 maxlength=50 > "&redx&"</td></tr><tr valign=top><td class=htd>评论内容:<br />250字内</td><td><textarea class=txtarea rows=8 cols=55 name=rword></textarea></td></tr><tr><td>发表评论:</td><td><input type=submit class=btn value='发表评论'> <input type=reset class=btn value='重新填写'></td></tr></form></table></td>" & _
vbcrlf&"</tr>" & _
vbcrlf&"</table>" & _
vbcrlf&"</td></tr>" & _
vbcrlf&"<tr><td><font class=red>文明上网,请不要发表带有反动、色情、暴力等违反国家法律法规的言论,违者后果自负!一经发现,永久封ID!</font> "& _
vbcrlf&"</td></tr></table>"
end if
review_type=tmp_review
End Functionfunction review_page(t1)
dim a
a="<a href='javascript:;' onclick=""javascript:open_win('"&t1&"','review_page',500,305,'no');""><img src='"&Cls.web_skindir&"small/reply.gif' border=0 align=absmiddle title='回复这条评论'></a>"
review_page=a
End Function
%>'-----------------------getReview.asp内容结束--------------------------4、'-----------------------getHits.asp内容开始--------------------------
<!-- #Include File="Skin.asp" -->
<%
ChannelIDs=Cls.Code_ID("c_id")
Call Channel_Loader()
Dim CounterID,GetCounter,aScore
CounterID=Cls.Code_ID("id")
tit=Trim(Request.Querystring("tit"))
Sql="Select top 1 Counter from "&Cls.ChannelTable&" where id="&CounterID
Set rs=Cls.exec(Sql,1)
If not rs.eof Then
GetCounter=Rs("Counter")
End If
rs.Close
If Cls.ChannelModuleType <> 2 Then
Call Cls.Exec("update "&Cls.ChannelTable&" set counter=counter+1 where id="&CounterID,0)
End If
aScore=cls.getreview(ChannelIDs,Counterid,"")
Response.Write "document.write (""" & GetCounter & " <b>得分</b>:"&aScore&""");"
%>
'-----------------------getHits.asp内容结束--------------------------
3、'-----------------------getReview.asp内容开始--------------------------
<%
dim review_page_num
review_page_num=Format_Mid_Num(27)
function review_type()
dim rtid,rtt,ruser,rturl,rtit,ChannelIDs,RScore
ChannelIDs=11
rtid=10
rturl="/Music/Music_singer.asp?action=singerlist&n_id=10"
rtt=1
ruser="suntech2000"
RScore=""
rtit="网络歌手" dim isadmin,rsr,sqlr,rusername,remail,rtype,rtim,retim,rword,reword,rrssum,tmp_review,reip,readonly
isadmin=false
if int(login_modep)=1 or int(login_modep)=2 then isadmin=true
if rtt=0 and ruser=login_username then isadmin=true
rrssum=0
sqlr="select count(rid) from AsaiMHReview where ChannelIDs="&ChannelIDs&" and re_id="&rtid
set rsr=Cls.exec(sqlr,1)
if not rsr.eof then
rrssum=rsr(0)
End If
dim rRScore,rtscore
rtscore=cls.getreview(ChannelIDs,rtid,"")
tmp_review=tmp_review&"<table cellspacing=1 cellpadding=4 class=rv_table>" & _
vbcrlf&"<tr><td class=rv_trt height=20>"
if rrssum=0 then
tmp_review=tmp_review&" 目前尚无评论,总评价 <font class=red>"&rtscore&"</font> 分"
else
tmp_review=tmp_review&" <a href='javascript:;' onclick=""javascript:open_win('"&Cls.Web_Dir&"Common/Review.asp?action=list&ChannelIDs="&ChannelIDs&" &re_id="&rtid&"&rtit="&server.urlencode(rtit)&"&ruser="&server.urlencode(ruser)&"','review_list',500,400,'yes');"">有 <font class=red>"&rrssum&"</font> 位网友参加了评论和打分</a>" & _
vbcrlf&" 共计 <font class=red>"&rtscore&"</font> 分"
end if
if int(login_modep)=1 or int(login_modep)=2 then
tmp_review=tmp_review&" <a href='"&Cls.Web_Dir&"Common/Review.asp?action=delete&ChannelIDs="&ChannelIDs&"&re_id="&rtid&"&rurl="&server.urlencode(rturl)&"' onclick=""javascript:return click_return('删除本文的所有评论内容',0);"">删除本文所有评论</a>"
End If
tmp_review=tmp_review&"</td></tr>"
sqlr="select top "&review_page_num&" rid,rusername,remail,rword,rtim,rtype,retim,reword,rip,RScore from AsaiMHReview where ChannelIDs="&ChannelIDs&" and re_id="&rtid&" order by rid desc"
set rsr=Cls.exec(sqlr,1)
do while not rsr.eof
rusername=rsr("rusername")
remail=rsr("remail")
rtype=rsr("rtype")
rtim=rsr("rtim")
retim=rsr("retim")
'rword=rsr("rword")
rword=Ubb.Ubbcode(rsr("rword"))
rword=Replace(rword,"<br />","")
'reword=rsr("reword")
reword=Ubb.Ubbcode(rsr("reword"))
reword=Replace(reword,"<br />","")
rRScore=rsr("RScore")
reip=ip_types(rsr("rip"))
if Cls.Is_Null(remail)<>"" then remail="<a href='mailto:"&remail&"'><img src='"&Cls.web_skindir&"small/email.gif' border=0 align=absmiddle title='"&rusername&" 的电子邮件:"&remail&"'></a>"
if rtype=1 then rusername=format_user_name(rusername,0,"")
rtim="<font class=tims>"&Cls.time_type(rtim,1)&"</font>"
tmp_review=tmp_review&"<tr class=rv_tr><td>" & _
vbcrlf&"<table border=0 cellspacing=1 cellpadding=4 width='100%' class=tf>" & _
vbcrlf&"<tr><td>"&img_skin("h_review")&" 网友 "&rusername&" 评[ <font class=red>"&rRScore&"</font> 分] <font class=Gys>["&reip&"] </font>"
tmp_review=tmp_review&"</td><td align=right>"&remail
if login_username=ruser and login_mode<>"" or isadmin then
tmp_review=tmp_review&" "&review_page(Cls.Web_Dir&"Common/Review.asp?action=reply&ChannelIDs="&ChannelIDs&" &re_id="&rtid&"&rid="&rsr("rid")&"&rurl="&server.urlencode(rturl)&"&rtit="&server.urlencode(rtit))
End If
if isadmin then
tmp_review=tmp_review&" <a href='"&Cls.Web_Dir&"Common/Review.asp?action=del&ChannelIDs="&ChannelIDs&"&re_id="&rtid&"&rid="&rsr("rid")&"&rurl="&server.urlencode(rturl)&"' onclick=""javascript:return click_return('删除这条评论内容',0);""><img src='"&Cls.web_skindir&"small/del.gif' border=0 align=absmiddle title='删除这条评论'></a>"
End If
tmp_review=tmp_review&" "&rtim&"</td></tr>" & _
vbcrlf&"<tr><td colspan=2><font class=blue><b>评:</b></font>"&Cls.code_html(rword,2,0)&"</td></tr>"
if Cls.Is_Null(reword)<>"" then
tmp_review=tmp_review&"<tr><td colspan=2><font class=red2><b>回:</b></font>"&Cls.code_html(reword,2,0)&"</td></tr>"
End If
tmp_review=tmp_review&"</table></td></tr>"
tmp_review=tmp_review&"<tr class=rv_trline><td></td></tr>"
rsr.movenext
loop
rsr.close
set rsr=nothing
readonly=""
if login_mode<>"" then readonly="readonly"
if int(format_mid_num(40))=1 and login_mode="" then
tmp_review=tmp_review& vbcrlf&"<tr class=rv_trb><td align=center height=20>发表评论请先 <a href='"&Cls.Web_Dir&"User/Register.asp'>注册</a> 或 <a href='"&Cls.Web_Dir&"User/Login.asp?old_url=back'>登陆</a> 本站!</td></tr></table>"
else
tmp_review=tmp_review&"<tr class=rv_trb><td align=center><table border=0 cellspacing=1 cellpadding=4 width='100%'><tr align=left><td width='100%'><table border=0 cellspacing=0 cellpadding=2><form name=review_frm action='"&Cls.Web_Dir&"Common/Review.asp?ChannelIDs="&ChannelIDs&"&re_id="&rtid&"&ruser="&ruser&"&rurl="&server.urlencode(rturl)&"' method=post onsubmit=""javascript:frm_submitonce(this);""><tr height=30><td>我来评分:<td><input type=radio name=RScore checked value='1'> 1分 <input type=radio name=RScore value='2'> 2分 <input type=radio name=RScore value='3'> 3分 <input type=radio name=RScore value='4'> 4分 <input type=radio name=RScore value='5'> 5分</td></tr><tr><td>您的姓名:</td><td><input type=text class=txt name=rusername value='"&login_username&"' size=25 maxlength=20 "&readonly&"> "&redx&"</td></tr><tr><td>电子邮箱:</td><td><input type=text class=txt name=remail value='"&login_email&"' size=25 id=0 maxlength=50 > "&redx&"</td></tr><tr valign=top><td class=htd>评论内容:<br />250字内</td><td><textarea class=txtarea rows=8 cols=55 name=rword></textarea></td></tr><tr><td>发表评论:</td><td><input type=submit class=btn value='发表评论'> <input type=reset class=btn value='重新填写'></td></tr></form></table></td>" & _
vbcrlf&"</tr>" & _
vbcrlf&"</table>" & _
vbcrlf&"</td></tr>" & _
vbcrlf&"<tr><td><font class=red>文明上网,请不要发表带有反动、色情、暴力等违反国家法律法规的言论,违者后果自负!一经发现,永久封ID!</font> "& _
vbcrlf&"</td></tr></table>"
end if
review_type=tmp_review
End Functionfunction review_page(t1)
dim a
a="<a href='javascript:;' onclick=""javascript:open_win('"&t1&"','review_page',500,305,'no');""><img src='"&Cls.web_skindir&"small/reply.gif' border=0 align=absmiddle title='回复这条评论'></a>"
review_page=a
End Function
%>'-----------------------getReview.asp内容结束--------------------------4、'-----------------------getHits.asp内容开始--------------------------
<!-- #Include File="Skin.asp" -->
<%
ChannelIDs=Cls.Code_ID("c_id")
Call Channel_Loader()
Dim CounterID,GetCounter,aScore
CounterID=Cls.Code_ID("id")
tit=Trim(Request.Querystring("tit"))
Sql="Select top 1 Counter from "&Cls.ChannelTable&" where id="&CounterID
Set rs=Cls.exec(Sql,1)
If not rs.eof Then
GetCounter=Rs("Counter")
End If
rs.Close
If Cls.ChannelModuleType <> 2 Then
Call Cls.Exec("update "&Cls.ChannelTable&" set counter=counter+1 where id="&CounterID,0)
End If
aScore=cls.getreview(ChannelIDs,Counterid,"")
Response.Write "document.write (""" & GetCounter & " <b>得分</b>:"&aScore&""");"
%>
'-----------------------getHits.asp内容结束--------------------------
function review_type()end function这两行去掉就要以了为什么用<script>不可以啊
<script type="text/javascript" src="/Include/getReview.asp"></script>
html页面嵌套<script src="/Include/getRv.asp"></script>-----getRv.asp-----
<!-- #Include File="/Include/getReview.asp" -->
<%
Response.Write "document.write ("""&review_type(ChannelIDs,rtid,rturl,rtt,ruser,"",rtit)&""");"
%>
review_type函数在getreview.asp里面,内容在上面主题已贴出来了
(我在动态调用review_type(ChannelIDs,rtid,rturl,rtt,ruser,"",rtit)是OK的)
这样改了还是不可以,郁闷.............
onsubmit='javascript:frm_submitonce(this);'
onclick='javascript:return click_return('删除本文的所有评论内容',0);'
疑问三:原来代码中有调用到自定义函数(过程),过程定义在同一个页面,原来可以用的,嵌套后,竟然不能用了,不是函数不能用是没有输入嵌套的内容,没有任何显示,把定义的过程删了,在调用过程的地方直接多行写代码,就可以了,十分超级不解! 最终问题解决了,还是很高兴的,昨晚改到1点多啊。
因为相信嵌套是可以的,判断不能显示可能就是asp代码的问题,需要修改。
于是,一行一行测试,先只输出很简单的一个表单,再加输出变量,再增加控件、输入框、文本框等等,可以了,再增加if、do while等等,再增加过程调用、js判断等等,但调用过程和js判断没弄成,其他都OK,很原来动态的asp页面一样(只差js判断没有,删除前没有确认...) 问题解决了,心情好了,阳光都变得更灿烂了