The ASP imitates the Google suggest style to realize the Drop-down menu effect _ Application Skill

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.