鱼缸过滤器材怎么摆放:ASP生成JS文件,各位帮忙写一段转

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/04 19:15:18
<%
if MDBpath="" then
MDBpath="admin/"
end if
set rs_type=server.CreateObject("ADODB.RecordSet")
set rs=server.CreateObject("ADODB.RecordSet")
%>
<!--#include file="admin/mdb_path_down.asp"-->
<%
i=0
sql="select top 12 cxn,cxv,id,tid,date,hits from down order by date desc"
rs.open sql,conn,1,1
if rs.eof then%>
<%
else
do while not rs.eof
%>
<IMG height=7 src="newgif/dot1.gif"
width=6 border=0>[
<%
rs_type.open "select tname from downtype where id="&rs("tid"),conn,1,1
if not rs_type.EOF then
TN=split(rs_type("tname"),"|")
response.write"document.write ('<a href=""sort/"&rs("tid")&"_1.htm"">"&TN(ubound(TN)-2)&"</a>')"
end if
rs_type.close
%>
]<a href="soft/<%=rs("id")%>.htm"><%=rs("cxn")&" "&rs("cxv")%></a></td>

<%
i=i+1
if i>=12 then exit do
rs.movenext
loop
end if
rs.close
%>
这段ASP代码如何写一段能输出JS的代码?我要放在首页调用的,作为首页最近更新标题。文件直接存成***.js 然后再ASP中调用各位朋友帮忙,多谢

topic.asp
调用时使用<SCRIPT LANGUAGE="JavaScript" SRC="topic.asp"></SCRIPT>

<%
if MDBpath="" then
MDBpath="admin/"
end if
set rs_type=server.CreateObject("ADODB.RecordSet")
set rs=server.CreateObject("ADODB.RecordSet")
%>
<!--#include file="admin/mdb_path_down.asp"-->
<%
i=0
sql="select top 12 cxn,cxv,id,tid,date,hits from down order by date desc"
rs.open sql,conn,1,1
if rs.eof then%>
<%
else
do while not rs.eof
response.write "document.write ('<IMG height=7 src=""newgif/dot1.gif"" width=6 border=0>['); "
rs_type.open "select tname from downtype where id=" & rs("tid"),conn,1,1
if not rs_type.EOF then
TN=split(rs_type("tname"),"|")
response.write "document.write ('<a href=""sort/" & rs("tid") & "_1.htm"">" & TN(ubound(TN)-2) & "</a>');"
end if
rs_type.close
response.write "document.write (']<a href=""soft/" & rs("id") & ".htm"">" & rs("cxn") & " " & rs("cxv") & "</a></td> ';"
i=i+1
if i>=12 then exit do
rs.movenext
loop
end if
rs.close
%>