是我的我的代碼.autocomplete不是一個函數錯誤下面
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<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>
而我的HTML代碼
<div class="ui-widget">
<input name="searcharea" class="selectarea" id="searcharea" type="text" value="" placeholder="Area">
</div>
我的功能是
<script>
$(function(){
$("#searcharea").autocomplete({
source: "suggestions.php"
});
$("#searchcat").autocomplete({
source: "suggestions1.php"
});
});
</script>
我已經包含了這個網頁與我的網站的搜索代碼一個單獨的文件,我已經內嵌它在不同的網頁,在我的索引頁,這是在暗示我從酸值CE文件,但在其他頁面上它給我typerror上線
$("#searcharea").autocomplete({
我的網站鏈接是: http://www.jodhpuryp.in/
這是我的自我暗示箱源 http://api.jqueryui.com/autocomplete/
誰能告訴我,爲什麼我在我的網站的其他頁面得到這個錯誤,而其對指數page.Any幫助工作是appreciated.Thanks
由於某種原因'jqueryui.js'沒有被加載到您的頁面上。檢查控制檯中的錯誤。 –
我做了,沒有錯誤發生,唯一的錯誤是TypeError,它表示自動完成未定義: – user2454340
你得到的代碼應該工作:http://jsfiddle.net/5TSDG/。檢查您的腳本加載是否正確。 –