我在Dreamweaver 里面写到一个网页输入框  想实现在里面查询到相关查询的类容  像优酷搜索框一样 用JQuery 吗?

解决方案 »

  1.   

    用到的东西包括,
    后台程序,数据库,js(ajax)
    你如果每个都会就可以,之会任意一个就不行,当然,一个都不会更不行……
      

  2.   

    http://developer.yahoo.com/yui/examples/autocomplete/ac_basic_array_clean.html   看看
    另外还有这个
    http://developer.yahoo.com/yui/examples/autocomplete/ac_basic_array.html
      

  3.   

    当然要用到后台数据库
    一般是select * from database where a like '%值%'
      

  4.   

    如果要操作数据库的话,说到底就是执行一sql,
    类似为 select * from tablename where column like '%queryId%' (其中queryId为页面传回的待查询的值)设计的有前台页面,后台数据库操作
    现在一般开发都用框架实现的,把前台的值传到后台,确保执行的语句类似为like '%queryId%'就可以了
    这样的模糊查询很好实现的
      

  5.   


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <title></title>
    <link href="css/style.css" rel="stylesheet" type="text/css" />
    <!--   引入jQuery -->
    <script src="../scripts/jquery-1.3.1.js" type="text/javascript"></script>
    <script type="text/javascript">
      $(function(){
           $("#filterName").keyup(function(){
          $("table tbody tr")
    .hide()
    .filter(":contains('"+( $(this).val() )+"')")
    .show();
       })
      })
    </script>
    </head>
    <body>
    <div>
    <br/>
    筛选:
    <input id="filterName" />
    <br/></div><table>
    <thead>
    <tr><th>姓名</th><th>性别</th><th>暂住地</th></tr>
    </thead>
    <tbody>
    <tr><td>张山</td><td>男</td><td>浙江宁波</td></tr>
    <tr><td>李四</td><td>女</td><td>浙江杭州</td></tr>
    <tr><td>王五</td><td>男</td><td>湖南长沙</td></tr>
    <tr><td>找六</td><td>男</td><td>浙江温州</td></tr>
    <tr><td>Rain</td><td>男</td><td>浙江杭州</td></tr>
    <tr><td>MAXMAN</td><td>女</td><td>浙江杭州</td></tr>
    <tr><td>王六</td><td>男</td><td>浙江杭州</td></tr>
    <tr><td>李字</td><td>女</td><td>浙江杭州</td></tr>
    <tr><td>李四</td><td>男</td><td>湖南长沙</td></tr>
    </tbody>
    </table></body>
    </html>差不多