【发布时间】:2012-07-09 23:41:31
【问题描述】:
我正在尝试使用 JQueryUI 自动完成,数据来自远程源(另一个 php 脚本)。 以下是 JQueryUI 网站上的演示中给出的示例:
<style>
.ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; }
</style>
<script>
$(function() {
function log( message ) {
$( "<div/>" ).text( message ).prependTo( "#log" );
$( "#log" ).scrollTop( 0 );
}
$( "#birds" ).autocomplete({
source: "search.php",
minLength: 2,
select: function( event, ui ) {
log( ui.item ?
"Selected: " + ui.item.value + " aka " + ui.item.id :
"Nothing selected, input was " + this.value );
}
});
});
</script>
我的问题是关于 PHP 脚本“search.php”。该脚本是否应该简单地返回一个数组?
【问题讨论】:
标签: php javascript jquery jquery-ui