I am struggling with the source option in autocomplete. The source data arrives as XML so I trying to reformat the data into an array of objects on success but the response callback does not work for me. In the code below, the first function for source does the correct server request and the array produced by jQuery.ajax.success is in the correct form AFAIK.
jQuery("input[name='cod']").autocomplete({
source: function(req, response) {
jQuery.ajax({
url: '/cgi-bin/search',
data: "type=client_code&code=" + req.term,
dataType: "xml",
success: function( xmlDoc ) {
console.log(xmlDoc);
var clients = [];
var Codes = xmlDoc.getElementsByTagName("client");
I thought that this data structure would be passed to the response callback and that would be enough but I can't detect that callback being invoked at all.