0
我有一個PHP文件,從我的mysqldb讀取數據作爲json數組。 如果用戶輸入3個字符,則應顯示數據。從php的Autosuggest
JS:
<link rel="stylesheet" href="js/demos.css"> //JQuery AutoSuggest Css
<script>
$(function() {
var availableTags = <?php include("/php/getAllRecipes.php"); ?>;
$("#searchrecipes").autocomplete({
source: availableTags
});
});
</script>
<input id="searchrecipes" type="text" name="searchrecipes" class="searchinput" style="margin-left: 850px; margin-top: 0px; width:170px; background: #fff url(images/search_icon.png) no-repeat 100%;" placeholder="Suchen..."></input>
<input type="submit"1 name="buttonsenden" style="display:none;" value="" width: 5px></input>
問題:
我們必須讓我們的JS卡列斯 「availableTags」 數據放入數組。
頁面的HTML源代碼是什麼,因爲它是由您的瀏覽器接收的? – CodeCaster