asp+ajax仿google搜索提示效果代码

2019-04-01 17:52:57刘景俊

<%Response.Charset="utf-8" %>
<!--#include file="conn.asp"-->
<%
dim Sift_value
dim Sql,Rs,I,Num
dim Contant
Contant=""
Num=10
Sift_value=replace(unescape(request.form("sift_value")),"""","""""")
Sql="select top "&Num&" keyword,matchnum from search where keyword like """&Sift_value&"%"" order by id"
set Rs=server.CreateObject("adodb.recordset")
Rs.open Sql,Conn,1,1
if not (Rs.eof and Rs.bof) then
for I=0 to Num-1
Contant=Contant&"'"&rs(0)&","&rs(1)&"'"
Rs.movenext
if Rs.eof then exit for
next
end if
response.Write(Contant)
Rs.close
set Rs=nothing
%>

您可能感兴趣的文章:

jquery ajax请求方式与提示用户正在处理请稍等php+ajax做仿百度搜索下拉自动提示框(有实例)ajax 自动完成下拉框 自动提示位置问题jquery+ajax+text文本框实现智能提示完整实例jquery实现ajax加载超时提示的方法使用jQuery全局事件ajaxStart为特定请求实现提示效果的代码Ajax实现智能提示搜索功能Ajax带提示的验证表单实例jquery formValidator插件ajax验证 内容不做任何修改再离开提示错误的bug解决方法ajax实现输入提示效果