我用html静态页面调用asp文件时,输出出错???在call newstitle 这个函数时,最后一个参数用到20时都可以,再大就输出不了??直接在地址输入newstitle.asp?keyid=1时是可以的,就是在静态页面输出时就不行了???
静态页面 test.html
<script src="include/newstitle.asp?keyid=1"></script>
动态页面 newstitle.asp
<!--#include file = "inc.asp"-->
<%
Select case request("keyid")
Case 1
call newstitle(10,"top 10 id,title,content","newlist","order by idasc","show/?",160)
End Select
%>
inc.asp
Function Strleft(Str,L)
Temp_Str=len(Str)
if Temp_Str > L then
For I=1 To Temp_Str
Test_Str=(Mid(Str,I,1))
Strleft=Strleft&Test_Str
If Asc(Test_Str)>0 Then
lens=lens 1
Else
lens=lens 2
End If
If lens>=2*L Then Exit For
Next
else
Strleft=Str
end if
End Function
Function brandtitle(tnum,fsql,table,odby,reurl,strlong)
sql = "SELECT "&fsql&" FROM "&table&" "&odby&" "
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, comm, 1, 1
If Not rs.EOF Then
Dim temp
for i=1 to tnum
temp = temp & "标题:"&rs(1)&"<br/>内容"&server.htmlencode(Strleft(rs(6),strlong))&"...<br/>"
rs.MoveNext
next
brandtitle = temp
Else
brandtitle = "无此信息."
End If
response.write "document.write("""&brandtitle&""");"
temp=""
rs.close
set rs=nothing
End Function