JS代码换成ASP代码 20
<%dimfoolcat,titledimjs,strsqlsetjs=server.CreateObject("ADODB.RecordSet")strSql="sel...
<%
dim foolcat,title
dim js,strsql
set js = server.CreateObject("ADODB.RecordSet")
strSql = "select top "&HOST_JS&" * from QiQiBoy_Topic_Disp where ParentID=0 Order By TopicID Desc"
set js = conn.Execute (StrSql)
do until js.eof
title=""&js("Title")&" - "&js("DateAndTime")&""
if len(title)>32 then
title=left(title,32)+"..."
else
title=title
end if
tmp = "http://" & request.servervariables("SERVER_NAME") & _
left(request.servervariables("SCRIPT_NAME"),len(request.servervariables("SCRIPT_NAME"))-len("/js/topic_js.asp"))
foolcat = foolcat + "·<a href="&tmp&"/p.asp?/="&js("RootID")&">" & title & "</a><br>"
i=i+1
if i>=HOST_JS then exit do
js.MoveNext
loop
foolcat = "" + foolcat + ""
foolcat = "document.write('" & foolcat & "')"
FolderPath = Server.MapPath("../")
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.CreateTextFile(FolderPath&"\topic_js.js")
fout.WriteLine foolcat
fout.close
set fout = nothing
js.close
set js = nothing
conn.close
set conn=nothing
%>
这是个JS代码..调用论坛的最新主题的
我想把它转成ASP代码..
我的意思是::不用经过JS调用..
直接用显示出来! 有没朋友帮忙改下.!
-.-! 这个是ASP代码... 它是JS调用的..
和JS连一起的...! 直接连接是不行的哦!! 展开
dim foolcat,title
dim js,strsql
set js = server.CreateObject("ADODB.RecordSet")
strSql = "select top "&HOST_JS&" * from QiQiBoy_Topic_Disp where ParentID=0 Order By TopicID Desc"
set js = conn.Execute (StrSql)
do until js.eof
title=""&js("Title")&" - "&js("DateAndTime")&""
if len(title)>32 then
title=left(title,32)+"..."
else
title=title
end if
tmp = "http://" & request.servervariables("SERVER_NAME") & _
left(request.servervariables("SCRIPT_NAME"),len(request.servervariables("SCRIPT_NAME"))-len("/js/topic_js.asp"))
foolcat = foolcat + "·<a href="&tmp&"/p.asp?/="&js("RootID")&">" & title & "</a><br>"
i=i+1
if i>=HOST_JS then exit do
js.MoveNext
loop
foolcat = "" + foolcat + ""
foolcat = "document.write('" & foolcat & "')"
FolderPath = Server.MapPath("../")
Set fso = Server.CreateObject("Scripting.FileSystemObject")
Set fout = fso.CreateTextFile(FolderPath&"\topic_js.js")
fout.WriteLine foolcat
fout.close
set fout = nothing
js.close
set js = nothing
conn.close
set conn=nothing
%>
这是个JS代码..调用论坛的最新主题的
我想把它转成ASP代码..
我的意思是::不用经过JS调用..
直接用显示出来! 有没朋友帮忙改下.!
-.-! 这个是ASP代码... 它是JS调用的..
和JS连一起的...! 直接连接是不行的哦!! 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询