[jQuery] [autocomplete] send a json object?

[jQuery] [autocomplete] send a json object?


Hi, i need to send a json object to the autocompleter. i see this
example on the demo:
    $("#thickboxEmail").autocomplete(emails, {
        minChars: 0,
        width: 310,
        matchContains: true,
        highlightItem: false,
        formatItem: function(row, i, max, term) {
            return row.name.replace(new RegExp("(" + term + ")", "gi"),
"<strong>$1</strong>") + "
<span style='font-size: 80%;'>Email:
&lt;" + row.to + "&gt;</span>";
        },
        formatResult: function(row) {
            return row.to;
        }
    });
the emails object var is a object, so
emails = {name: 'aasdfasd', to: 'asdfqweqwe'}
i need just that, the problem is that my mail is on a mysql DB. i dont
want to send a "one item per line". i want to send a json object. is
there anyway?