我正在尝试遵循jquery easyAutocomplete文档并得到这个错误。我知道这是一个很常见的问题,有人问了一小撮。但他们似乎都没有抹去我的错误。这是我的密码
test.js
var options = {
url: "places.json",
getValue: "name",
list: {
match: {
enabled: true
}
},
theme: "square"
};
$("#textbox").easyAutocomplete(options);html
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>test</title>
<link
rel="stylesheet"
href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css"
/>
</head>
<body>
<div>
Location: <br />
<br />
<input type="text" name="enterlocation" id="textbox" />
<button>enter</button>
</div>
</body>
<script src="https://code.jquery.com/jquery-3.4.1.js"></script>
<script async src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script src="test.js"></script>
</html>杰森:
[
{ "name": "Afghanistan", "code": "AF" },
{ "name": "Aland Islands", "code": "AX" },
{ "name": "Albania", "code": "AL" },
{ "name": "Algeria", "code": "DZ" },
{ "name": "American Samoa", "code": "AS" }
]发布于 2019-08-01 16:25:37
在EasyAutocomplete指南中,它说:
为了使用EasyAutocomplete,请将这些文件添加到页面的标题部分。记住要包括jQuery文件。您可以从jQuery网站下载库。最佳实践是使用CDN服务器:
基于此,您需要在jquery.easy-autocomplete.min.js之后并在您自己的代码之前包括jQuery。您还应该包括easy-autocomplete.min.css。
https://stackoverflow.com/questions/57310815
复制相似问题