Many netizens asked how to create a JS News calling program, which is now posted for your reference:
JS Caller:
List2.asp
Source code :--------------------------------------------------------------------------------
<! -- # Include file = "Conn. asp" -->
<%
Dim RS, SQL
Dim specid' Resource feature 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 ("" <a href = '/Tsys/NewsFiles/"& Rs (" FilePath ") &" 'target =' _ blank '> "& Rs (" Title ") & "</a> <br/>" ")" & vbCrLf
Rs. MoveNext
Wend
Rs. Close
Set Rs = Nothing
%>
--------------------------------------------------------------------------------
Call method:
Source code :------------------------------------------------------------------------
<Script src = "list2.asp? SpecId = 13 "> </script>
--------------------------------------------------------------------------------
Let's take a look at ............ the above is TSYS1.0 ....
Below is the TSYS1.1 enhanced version I wrote ..
<! -- # Include file = "Include/Config. asp" -->
<%
Dim RS, SQL
Dim specid' Resource feature 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 ("" <a href = '"& Rs (" FilePath ") &" 'target =' _ blank '> "& Rs (" Title ") & "</a> <br/>" ")" & vbCrLf
Rs. MoveNext
Wend
Rs. Close
Set Rs = Nothing
Conn. close
Set conn = nothing
%>
We can see that Include/Config. asp should know where it is stored...
You can see the demo:
Http://31u.net/html/zhuanti/daima005.htm
The recommendation information of www.31u.net homepage is called... the feature is 35 ..
Of course, you can write the JS News list in the column according to this... from 31u.com