Today and everyone together using ASP to simulate the implementation of Google suggest style pull-down menu, directly on the code
1. Front Code:
<% @LANGUAGE = "JAVASCRIPT" codepage= "936"%> <! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
">
2. Background search.asp asynchronous Query data page
It is OK to change the SQL statement and the fields to be displayed to their own database.
<!--#include virtual= "conn.asp"-->
<%
keyword=request. QueryString ("names")
sql= "Select LGID,LGMC from LG where LGMC like '%" &keyword& "% ' ORDER by lgid desc"
SE T Rs=server. CreateObject ("Adodb.recordset")
rs.open sql,conn,1,1
response.contenttype= "Text/xml"
Response. Write "<?xml version=" "1.0" "encoding=" "GB2312" "?>"
response. Write "<response>" do, not
rs.eof
response. Write "<content>"
response. Write "<name>" &rs ("LGMC") & "</name>"
' response. Write "<userid>" &rs ("userid") & "</userid>"
' response. Write "<startime>" &rs ("Startime") & "</startime>"
' response. Write "<endtime>" &rs ("Endtime") & "</endtime>"
response. Write "</content>"
rs.movenext
Loop
response. Write "</response>"
rs.close
set rs=nothing
%>
Above is the ASP imitate the Google suggest style to achieve the Drop-down menu effect code, hope to be helpful to everybody's study.