调用代码:
<script language="javascript" src="hot_news.asp?SmallClassID=2&n=5"></script>
注释:
n为显示的条数
hot_news.asp页面的代码:
javastr=""
javastr=javastr+"<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"
<!--#include file="include/buyok_shop_30_conn.asp"-->
<%
SmallClassID=Trim(Request("SmallClassID"))
n=request("n")
if n="" then
n=20
end if%>
<%
'if owen1<>"" and owen2<>"" then
sql="select
set rs=conn.execute(sql)
do while not rs.eof
%>
javastr=javastr+"<tr><td height=\"24\" style=\"BORDER-bottom: #999999 1px dotted\">"
javastr=javastr+"◎ <span style=\"font-size:9pt;line-height:15pt\"><a href=\"onews.asp?id=<%=rs("NewsID")%>\" title=\"<%=rs("NewsTitle")%>\" target=\"_blank\"><%=left(rs("NewsTitle"),12)%></a></span> "
javastr=javastr+"</td></tr>"
<%n=n-1
if n<1 then exit do
rs.movenext
loop
%>
javastr=javastr+"</table>"
<%
rs.close
set rs=nothing
%>
document.write (javastr)