So I've been through an interesting learning experience. The end product produces this... No matter how hard I try I can not get the autocomplete to kick in .... I type in DELTA in the #air input field, it makes the request I get back a 200 on the response but then what? What am I missing here... Incidentally to me this looks like a simple Json response and not a JsonP response but for some reason when I send the request as Json I get a 401 error however just changing it to JsonP I get back the 200 responses.
Can someone help me comprehend why I can't get the dropdown to show the airline names (and record the selected airline code
Thanks...
[
{
"id": "DL",
"label": "DELTA AIRLINES"
},
{
"id": "GG",
"label": "Delta Airlines (Group Space)"
}
]
To get it I do this...
$(function() {
var url="http://<<ourinternalserver>>.com/scripts/broker.dll?_program=tas.json_airlines_test.sas";
$( "#air" ).autocomplete({
source: function( request, response ) {
$.ajax({
url: url,
dataType: "jsonp",
data: {
term: request.term
},
success: function( data ) {
console.log('success');
} // end of success
}); // end of ajax
},
minLength: 2
});
});