2
<script type="text/javascript">
$(function() {
$("#searchTerm").autocomplete({
//appendTo:"#abc",
// position: { my : "right top", at: "right bottom" },
source: "home/search",
minLength: 1,
autoFocus: true,
select: function (event, ui) {
if (ui.item) {
$("#searchTerm").val(ui.item.value);
$("form").submit();
}
else { alert("abc")}
}
});
});
</script>
我尝试了几件事情,但不知何故我不能破解这个简单的事情。在此先感谢想要添加警告如果searchTerm长度== 0