Home > Backend Development > PHP Tutorial > 求 jquery autocomplete 和数据库 联接,即数据来自数据库?

求 jquery autocomplete 和数据库 联接,即数据来自数据库?

WBOY
Release: 2016-06-13 12:37:55
Original
838 people have browsed it

求 jquery autocomplete 和数据库 连接,即数据来自数据库??急急急
jquery autocomplete 代码:

以下代码里面的搜索是写死的,我想根据输入的内容去到数据库里面查询,数据库是 mysql 的,开发环境是php 

nbsp;html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">



Insert title here

 <script></script>
 <script></script>
 

<script><br /> var websites = [<br /> "上海","海浪", "北京", "广州", "Sogou", "Baidu", "Tencent", <br /> "Taobao", "Tom", "Yahoo", "JavaEye", "Csdn", "Alipay"<br /> ];<br /> $().ready(function() {<br /> $("#website").autocomplete(websites); <br /> });<br /> <br /> </script>




                                      
<script><br /> $().ready(function() {<br /> <br /> function findValueCallback(event, data, formatted) {<br /> $("#content").html("<strong>"+(!data ? "No match!" : "Selected: " + formatted)+"");<br /> }<br /> <br /> $("#website").autocomplete(websites,{<br /> minChars: 0,<br /> max: 5,<br /> autoFill: true,<br /> mustMatch: true,<br /> matchContains: true,<br /> scrollHeight: 220,<br /> formatItem: function(data, i, total) { <div class="clear"> </script>
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template