对象不支持属性或方法'autocomplete'

时间:2013-11-27 15:06:41

标签: jquery-autocomplete

我收到了上述错误。以下是我的代码段。

<link rel="stylesheet" href="/css/autoComplete/jquery-ui.css" />
<link rel="stylesheet" href="/css/core.css">
<link rel="stylesheet" href="css/theme.css">
<link rel="stylesheet" href="/css/datepicker.css">
<link rel="stylesheet" href="/css/customlook.css">
<link rel='stylesheet' href='/css/Header.css' />
<link rel='stylesheet' href='/css/Test.css' />
<script type="text/javascript" src="/js/autoComplete/jquery.min.js"></script>
<script type="text/javascript" src="/js/autoComplete/jquery-ui.min.js"></script>
<script type="text/javascript" src="/js/advanced_search_filters.js"></script>
<script type="text/javascript" src="/js/dateJs/jquery.js"></script>
<script type="text/javascript" src="/js/dateJs/core.js"></script>
<script type="text/javascript" src="/js/dateJs/datepicker.js"></script>
<script type="text/javascript" src="/js/user.js"></script>
<script type="text/javascript" src="/js/utils.js"></script>
<script type="text/javascript">
$(document).ready(function() {
    alert('testing');
    $("#CARD_HOLDER_NAME").autocomplete({
      source : '${pageContext. request. contextPath}/cardHolderName'
     });
    });
</script>

请帮我解决。

1 个答案:

答案 0 :(得分:0)

您遗失/错误放置 jQuery / jQuery UI.js / autocomplete.js文件,订单应为

(1) jQuery.js
(2) jQuery UI.js
(3) autocomplete.js

在自动填充之前添加​​以下内容

<script src="http://code.jquery.com/jquery-1.9.1.js />
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js" />