JS调用新闻

调用代码:

<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  * from NEWS where SmallClassID="& SmallClassID &" order by NewsID desc"
set rs=conn.execute(sql)
do while not rs.eof
%>
javastr=javastr+"<tr><td height=\"24\" style=\"BORDER-bottom: #999999 1px dotted\">"
javastr=javastr+"◎&nbsp;<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)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值