3

何日も探していますが、修正が見つかりません。

これが私のコードです(コア機能に短縮されています):

$("input").autocomplete({
    source: function( request, response ){
        $.ajax({
            url: 'inc/ajax.php',
            type: "GET",
            async: true,
            dataType: "json",
            data: {
              'task' : 'tasktodo',
              'squery' : request.term
            }, 
            success: 
                function( data ) {
                    response($.map( data, function(item){
                        return {
                            label : item['name'],
                            value : item['name']
                        }
                    }));
                }
        });     
    }
});

オートコンプリートは機能しますが、ブラウザーのコンソールに次のエラーが表示されます。

 Uncaught TypeError: Object  has no method 'results' (in Chrome)
 TypeError: this.options.messages.results is not a function (in Firefox)

"response()"エラーは、私のスクリプトで呼び出される jqueryui.js の行を指しています。

エラーは機能に影響しませんが、エラーが発生する理由を知りたいです。

4

3 に答える 3