一段代码输出问题,解决马上散分,在线等
下面代码错误处已经标明,
<%
newsID=GetSafeInt(request("newsID"),0)
list=GetSafeInt(request("list"),0)
znum=GetSafeInt(request("znum"),0)
tj=GetSafeInt(request("tj"),0)
if list<1 then
list=3
end if
if znum<1 then
znum=10
end if
if newsID<1 then
TempContent=TempContent&"数据参数出错"
else
TempContent=TempContent&"<table width=279 border=0 cellspacing=0 cellpadding=0>"
select case tj
case 1
sqlx="select * from zg_article where articleTypeID="&newsID&" order by addDate desc"
case 2
sqlx="select * from zg_article where articleTypeID="&newsID&" order by addDate desc"
case else
sqlx="select * from zg_article where articleTypeID="&newsID&" order by addDate desc"
end select
openrs rsx,sqlx,1,1
if not rsx.eof then
i=1
do while not rsx.eof
if i=1 then
TempContent=TempContent&"<tr><td height=20 bgcolor=#F1F1F1>"
TempContent=TempContent&"<span class=cy_xinxi>·</span><a href=/news/"&rsx("htmlurl")&" class=cy_xinxi_1 target=_blank>"&left(rsx("title"),znum)&"</a></td></tr>"
TempContent=TempContent&"<tr><td height=150 bgcolor=#F1F1F1>"
'======================================================================
'=======================================================================
'此段代码出错,数据无法输出,曾实验过content=left(rsx("content"),37)最多输出37个,超过37不能输出,其他地方无错,noencode函数用于去除格式
'======================================================================
content=left(replace(replace(replace(replace(noEncode(rs("content"))," ","")," ",""),"<P>",""),"</P>",""),150)
TempContent=TempContent&"<span class=cy_zicun> "&content&"...</span><span class=cy_xw_1>[正文]</span>"
'============================================================================
'============================================================================
'============================================================================
TempContent=TempContent&"</td></tr>"
else
TempContent=TempContent&"<tr>"
TempContent=TempContent&"<td height=19 valign=bottom>"
TempContent=TempContent&"·<a href=/news/"&rsx("htmlurl")&" class=cy_xinxi target=_blank>"&left(rsx("title"),znum)&"</a></td>"
TempContent=TempContent&"</tr>"
end if
i=i+1
rsx.movenext
list=list-1
if list<1 then exit do
loop
closers rsx
else
TempContent=TempContent&"<tr><td> </td></tr>"
end if
TempContent=TempContent&"</table>"
end if
%>
document.write("<%=TempContent%>")