vbscript和javascript之间的函数的调用

类别:Asp 点击:0 评论:0 推荐:

<%
server1=cstr(request.servervariables("http_referer"))
server2=cstr(request.servervariables("server_name"))
if mid(server1,8,len(server2))<>server2 then
 response.end()
end if
keyword=vb_unescape(request("keyword"))
keyword=replace(keyword,"'","''")
set conn=server.createobject("ADODB.CONNECTION")
connstr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../***")
conn.open connstr

str=""
set rs=conn.execute("select top 25 * from mp3 where mp3name like '%"&keyword&"%' order by len(mp3name)")
if rs.eof and rs.bof then
 response.Write("没有找到")
else
 i=1
 for i=1 to 25
  if rs.eof then exit for
  str=str&i&".<span style=""cursor:hand"" onClick=""opener.mkList('"&rs("mp3url")&"','"&rs("mp3name")&"');"">"&rs("mp3name")&"</span><a href='"&rs("mp3url")&"'>下载</a><br>"
  rs.movenext
 next
end if
str=vb_escape(str)
response.Write(str)
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<script language="javascript" runat="server">
function vb_escape(str)
{
 return escape(str);
}
function vb_unescape(str)
{
 return unescape(str);
}
</script>

本文地址:http://com.8s8s.com/it/it7822.htm