【发布时间】:2011-11-04 16:23:02
【问题描述】:
我有一个 php 文件,它从我的 mysqldb 中读取数据作为 json 数组。 如果用户输入 3 个字符,则应显示数据。
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 源代码是什么?
标签: php javascript html json