views:

20

answers:

1
$(document).ready(function() {
        $('#nome_dominio').autocomplete("testeJson2.php", {

            parse: function(data) {

            },

            formatItem: function(result) {

                return formatar(result);
            }

        }).result(function(e, result) {

                    alert ('escolheu algo');
            });
    });

Result in an object (array). data is string. They both should correspond to the same http response. Why is that? :S X.X :(

Regards, MEM

A: 

Probably something on your server.

To make the result into an object:

$.parseJSON(result);
Mark
Actually I don't care if I have a string or an object... I just need to have the proper format so that autocomplete accepts it and parses is correctly. I've not tried to parse the result by using that method... but I will give it a try. I swear I will do a tutorial when this is over... :s Thanks.
MEM