Home >php教程 >php手册 >搜索框自动输入(jQuery结合PHP+Mysql)

搜索框自动输入(jQuery结合PHP+Mysql)

WBOY
WBOYOriginal
2016-06-07 11:39:031593browse

通过jQuery ui的autocomplete插件,调用PHP数据来完成自动输入功能。
搜索框自动输入(jQuery结合PHP+Mysql)

页面底部有演示、免费下载链接。若是想看更多js特效网站源码js教程请访问 http://www.sucaihuo.com/js 还有演示DEMO,最主要是可以免费下载。1、<br> 首先加载jQuery库和autocomplete相关组件:<br> <link>  <br> <script></script>  <br> <script></script>  <br> <script></script>  <br> <script></script>  <br> <script></script><br> 然后我们加一个搜索框,用来自动完成输入功能:<br> <input><br> 2、<br> 最后远程调用ajax.php返回json数据:<br> $(function(){  <br>     $("#keywords").autocomplete({  <br>         source: "ajax.php",  <br>         minLength: 1  <br>     });  <br> });查看该特效演示及免费下载,请访问http://www.sucaihuo.com/js/51.html

AD:真正免费,域名+虚机+企业邮箱=0元

Statement:
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