工作,我已经得到了6000加用户名,我已经从MySQL拉到一个这样的数组:jQuery的自动完成不与大阵
$pop = mysql_query("SELECT * FROM import_student");
while ($r = mysql_fetch_assoc($pop)) {
$student_array[] = $r['studentfirstname']." ".$r['studentlastname'];
}
$big_array = json_encode($student_array);
然后我通过这个数组JS和初始化我自动完成像这样的功能。
<script>
$(document).ready(function() {
var availableTags = <?php echo $big_array; ?>;
console.log(availableTags);
$("#tags").autocomplete({
source: availableTags
});
});
</script>
当我限制SQL结果0,10这个伟大的工程,但是当我不限制,我得到了6000名左右的用户名到阵列中,自动完成无法正常工作。我在萤火虫中得到这个错误:
value is null
return matcher.test(value.label || value.value || value);
任何人都知道我在做什么错在这里?就像我说的那样,当我限制结果时,这是有效的。有关大阵列的事情? IDK。