有很多网友再问如何做一个JS新闻调用程序,现在贴出来供大家参考:
JS调用程序:
List2.asp
源码:--------------------------------------------------------------------------------
<>
<%
DimRS,Sql
DimSpecId'资源特性Id
SpecId=CLng(Request("SpecId"))
Sql="selectTop10Id,Title,FilePathFromview_NewsInfowhereInstr(','+Speciality+',',',"&SpecId&",')<>0OrderByIdDESC"
SetRs=Conn.ExeCute(Sql)
WhileNotRs.Eof
Response.Write"document.write(""<ahref='/Tsys/NewsFiles/"&Rs("FilePath")&"'target='_blank'>"&Rs("Title")&"</a><br/>"")"&vbCrLf
Rs.MoveNext
Wend
Rs.Close
SetRs=Nothing
%>
--------------------------------------------------------------------------------
调用方法:
源码:------------------------------------------------------------------------
<scriptsrc="list2.asp?specId=13"></script>
--------------------------------------------------------------------------------
说明一下..............上面是TSYS1.0的....
下面是我写的TSYS1.1加强版的..
<>
<%
DimRS,Sql
DimSpecId'资源特性Id
SpecId=CLng(Request("SpecId"))
DimConn
SetConn=Server.createObject("Adodb.Connection")
Conn.OpenConnStr
Sql="selectTop10Id,Title,FilePathFromview_NewsInfowhereInstr(','+Speciality+',',',"&SpecId&",')<>0OrderByIdDESC"
SetRs=Conn.ExeCute(Sql)
WhileNotRs.Eof
Response.Write"document.write(""<ahref='"&Rs("FilePath")&"'target='_blank'>"&Rs("Title")&"</a><br/>"")"&vbCrLf
Rs.MoveNext
Wend
Rs.Close
SetRs=Nothing
conn.close
setconn=nothing
%>
大家看Include/Config.asp应该知道保存在什么地方了吧...
大家可以看下演示:
http://31u.net/html/zhuanti/daima005.htm
调用的是www.31u.net首页的推荐信息...特性为35..
当然可以根据这个来写出分栏目的JS新闻列表...from31u.com