Javascript TypeError:$(…)。easyAutocomplete不是函数
我试图跟随jquery并得到这个错误。我知道这是一个非常常见的问题,在这方面也有人提出过一些问题。但它们似乎都不能消除我的错误。这是我的密码 test.jsJavascript TypeError:$(…)。easyAutocomplete不是函数,javascript,jquery,autocomplete,easyautocomplete,Javascript,Jquery,Autocomplete,Easyautocomplete,我试图跟随jquery并得到这个错误。我知道这是一个非常常见的问题,在这方面也有人提出过一些问题。但它们似乎都不能消除我的错误。这是我的密码 test.js var options = { url: "places.json", getValue: "name", list: { match: { enabled: true } }, theme: "square" }; $("#textbox").easyAutocomplete(opti
var options = {
url: "places.json",
getValue: "name",
list: {
match: {
enabled: true
}
},
theme: "square"
};
$("#textbox").easyAutocomplete(options);
html
在报告中,它说:
为了使用EasyAutocomplete,请将这些文件添加到
你的页面
<!-- JS file -->
<script src="path/to/jquery.easy-autocomplete.min.js"></script>
<!-- CSS file -->
<link rel="stylesheet" href="path/to/easy-autocomplete.min.css">
<!-- Additional CSS Themes file - not required-->
<link rel="stylesheet" href="path/to/easy-autocomplete.themes.min.css">
记住要包括jQuery文件。您可以从下载库。最佳做法是使用CDN服务器:
<!-- Using jQuery with a CDN -->
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
基于此,您需要在jquery之后和您自己的代码之前包含
jquery.easy autocomplete.min.js
。您还应该包括easy autocomplete.min.css
您还没有在页面中包括easyautocomplete库。它不是标准的jQuery方法。请参阅文档的“入门”部分:将easyautocomplete库包含在第页中,错误就会消失。您能告诉我如何找到路径/to/
?我正在使用ubuntu@ProteetiProva由于您将CDN用于其他内容,因此您可能可以使用https://cdnjs.cloudflare.com/ajax/libs/easy-autocomplete/1.3.5/jquery.easy-autocomplete.min.js
和https://cdnjs.cloudflare.com/ajax/libs/easy-autocomplete/1.3.5/easy-autocomplete.min.css
。
<!-- JS file -->
<script src="path/to/jquery.easy-autocomplete.min.js"></script>
<!-- CSS file -->
<link rel="stylesheet" href="path/to/easy-autocomplete.min.css">
<!-- Additional CSS Themes file - not required-->
<link rel="stylesheet" href="path/to/easy-autocomplete.themes.min.css">
<!-- Using jQuery with a CDN -->
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>