私はこのような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}]
それは見返りに何か他のものを期待していますか