autocomplete无法使用,请教大家,代码如下

Mångata.. 2018-05-06 10:02:09
HTML:
<script type="text/javascript" src="../js/jquery-3.3.1.js"></script>
<script src="../js/jquery.autocomplete.min.js"></script>
<link href="../Sheet/autocomplete.css" rel="stylesheet" />

<input type="text" id="abc"/>

JS:
var websites = ["Google", "NetEase", "Sohu", "Sina", "Sogou", "Baidu", "Tencent",
"Taobao", "Tom", "Yahoo", "JavaEye", "Csdn", "Alipay"];
$("#abc").autocomplete({ source: websites });
...全文
774 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
Mångata.. 2018-05-07
  • 打赏
  • 举报
回复
在想是不是引用的库有问题
Mångata.. 2018-05-07
  • 打赏
  • 举报
回复
引用 1 楼 guwei4037 的回复:
参考这里面的示例代码,http://jqueryui.com/autocomplete/ $(function(){ ... })
这里面看过的,还有很多网上的博客,你看我的代码,用了最简单的一种,还是不行
全栈极简 2018-05-07
  • 打赏
  • 举报
回复
参考这里面的示例代码,http://jqueryui.com/autocomplete/ $(function(){ ... })
Mångata.. 2018-05-07
  • 打赏
  • 举报
回复
引用 6 楼 apple8160 的回复:
你引用错库了吧 你只要引用 jquery.js jquery-ui.css jquery-ui.js 这3个就可以
我改了下引用还是不行 <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title></title> <link href="sheet/jquery-ui.css" rel="stylesheet" /> <script src="Scripts/jquery-3.3.1.js"></script> <script src="Scripts/jquery-ui-1.8.20.js"></script> <script type="text/javascript"> var web = ["baidu", "baida", "baitan"]; $("#IN").autocomplete({ source: web }); </script> </head> <body> <form> <div> <input id="IN"/> </div> </form> </body> </html>
apple8160 2018-05-07
  • 打赏
  • 举报
回复
你引用错库了吧 你只要引用 jquery.js jquery-ui.css jquery-ui.js 这3个就可以
Mångata.. 2018-05-07
  • 打赏
  • 举报
回复
引用 4 楼 guwei4037 的回复:
https://blog.csdn.net/chinacsharper/article/details/17473157
不行的,我博客看了很多,可就是自己的不行

62,025

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧