有很多网友再问如何做一个JS新闻调用程序,现在贴出来供大家参考:
JS调用程序:
List2.asp
源码:——————————————————————————–
<%
Dim RS,Sql
Dim SpecId ‘资源特性Id
SpecId=CLng(Request(“SpecId”))
Sql=”select Top 10 Id,Title,FilePath From view_NewsInfo where Instr(‘,’+Speciality+’,’,’,”&SpecId&”,’)0 Order By Id DESC”
Set Rs=Conn.ExeCute(Sql)
While Not Rs.Eof
Response.Write “document.write(“”“&Rs(“Title”)&”
“”)” & vbCrLf
Rs.MoveNext
Wend
Rs.Close
Set Rs=Nothing
%>
——————————————————————————–
调用方法:
源码:————————————————————————
——————————————————————————–
说明一下…………..上面是TSYS1.0的….
下面是我写的TSYS1.1加强版的..
<%
Dim RS,Sql
Dim SpecId ‘资源特性Id
SpecId=CLng(Request(“SpecId”))
Dim Conn
Set Conn = Server.createObject(“Adodb.Connection”)
Conn.Open ConnStr
Sql=”select Top 10 Id,Title,FilePath From view_NewsInfo where Instr(‘,’+Speciality+’,’,’,”&SpecId&”,’)0 Order By Id DESC”
Set Rs=Conn.ExeCute(Sql)
While Not Rs.Eof
Response.Write “document.write(“”“&Rs(“Title”)&”
“”)” & vbCrLf
Rs.MoveNext
Wend
Rs.Close
Set Rs=Nothing
conn.close
set conn=nothing
%>
大家看Include/Config.asp应该知道保存在什么地方了吧…
大家可以看下演示:
http://31u.net/html/zhuanti/daima005.htm
调用的是www.31u.net首页的推荐信息…特性为35..
当然可以根据这个来写出分栏目的JS新闻列表… from 31u.com