我正在尝试在我的应用程序中集成Jquery自动完成功能。所需的js文件已如下所示:
<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/jquery-1.8.3.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/jquery.ui.core.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/jquery.ui.widget.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/jquery.ui.autocomplete.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/jquery-ui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/scripts/script.js"></script>
'scripts.js'文件是包含以下代码的特定于应用程序的文件:
$(document).ready(function() {
$('#aisleFrom').autocomplete({
url: '/StoreMapperApp/MapPickingZone.action?autocomplete=',
minChars: 0,
max: 10,
width: 150,
scroll: true,
cacheLength: 0
}).focus(function() {
$(this).autocomplete('search', $(this).val())
});
});
然而,当我尝试在id为'aisleFrom'的文本框中输入任何内容时,我在jquery-ui.min.js文件中收到以下错误:
TypeError: this.source不是一个函数 ...complete-loading"),this.cancelSearch=!1,this.source({term:e},this._response())},...
请问有人可以提供建议吗?