這段代碼有什麼問題?當我鍵入單詞時,建議不會以正確的形式出現。jquery autocomplete錯誤視圖
還有什麼我應該加載?
更新代碼: 找到了答案: `<鏈接相對
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
</head>
<body>
<form>
<div class="list">
<div class="item">
<input type="hidden" class="user-id" id="h1"/>
<input type="text" class="user-name" id="t1"/>
</div>
</div>
</form>
<script>
var users = [
{"label":"User 1","value":"User 1","userId":1},
{"label":"User 2","value":"User 2","userId":2}
];
$(".user-name").autocomplete({
source: users,
autoFocus: true,
delay: 0,
});
</script>
</body>
</html>
只需要一行額外的代碼對我的作品=「stylesheet」type =「text/css」href =「http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/redmond/jquery-ui.css」>' – monjevin