![]() ![]() ![]() ![]() |
|||||
|
|||||
樓主 大家加油 ![]()
![]() |
我的網頁語法如下 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>upload</title></head><body> <script type="text/javascript" src="jquery-1.2.6.min.js"></script><table> <tr class="tabtitle"> <td width="25%" height="27"><font size="2">輸入</font></td> <td width="58%" height="27" ><input id='demo2' type='text' name='demo2' value='' Size='40' /> <script type='text/javascript'> $('#demo2').autocomplete('autocomplete2.php',{minChars: 1,mustMatch: true}); </script> </td></tr> </table> </body></html> 而autocomplete2.php語法為 <?php mysql_connect("localhost", "yy", "") or die("無法連結主機"); mysql_select_db("test1") or die("無法連結資料庫"); mysql_query("SET NAMES utf8"); $q=$_GET["q"]; //$q=$_GET["term"]; $q=$_GET["demo2"] $abc="select CustomerID from customers where CustomerID like '#$q#' ;"; $sql = @mysql_query($abc); while($list=mysql_fetch_array($sql)) { echo $list['CustomerID']."\n"; } } ?> 請問為何autocomplete沒有效果呢 謝謝!
本篇文章發表於2013-12-14 00:35
|
1樓
最有價值解答
香帥 ![]() |
您缺少引用
<script src="jquery.autocomplete.js" type="text/javascript"></script> 請至 http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ 下載
本篇文章回覆於2013-12-14 08:45
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔-- |
回覆 |
如要回應,請先登入. |