我正在使用这样的 jquery 自动完成插件
$( "#city" ).autocomplete({
source: function( request, response ) {
$.ajax({
url: "http://www.abc.com/test.php",
dataType: "jsonp",
data: {
featureClass: "P",
style: "full",
maxRows: 12,
name_startsWith: request.term
},
success: function( data ) {
alert("hello");
}
});
},
minLength: 2,
select: function( event, ui ) {
log( ui.item ?
"Selected: " + ui.item.label :
"Nothing selected, input was " + this.value);
},
open: function() {
$( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" );
},
close: function() {
$( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" );
}
});
我没有收到任何关于成功的警报框。
Firefox 显示我得到了这个作为响应
[{"label":"mark2","value":1},{"label":"abc1","value":20}]
它是否期望其他任何回报