I have the a ASP.NET 2.0 json web service that returns the following response
<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://microsoft.com/webservices/">[{"CUName":"Raytown-Lee\u0027s Summit Comm CU","CUCity":"RAYTOWN","CUState":"MO","CUContractNo":"02406"},{"CUName":"Summit Credit Union","CUCity":"MADISON","CUState":"WI","CUContractNo":"04800"},{"CUName":"Summit Credit Union","CUCity":"GREENSBORO","CUState":"NC","CUContractNo":"03200"},{"CUName":"Summit Hampton Roads FCU","CUCity":"NORFOLK","CUState":"VA","CUContractNo":"04504"},{"CUName":"SummitOne Federal CU","CUCity":"OGDEN","CUState":"UT","CUContractNo":"14301"}]</string>
When I bind this to my test box for use with the autocomplete plugin, I don't see any results in the dropdown. I checked with firebug that the call is made.
My front end call looks like below
$(document).ready(function() {
$("#city").autocomplete("CUList.asmx/GetCUList", {
dataType: 'jsonp',
parse: function(data)
{
var rows = new Array();
for(var i=0; i<data.length; i++){
rows[i] = { data:data[i], value:data[i].CUName, result:data[i].CUName };
}
return rows;
},
formatItem: function(row, i, n) {
return row.CUName + ', ' + row.CUCity;
},
max: 50
});
});
Can someone please let me know what I am doing wrong?
Thanks