Trying to first .getJSON then using that data to become the source of my autocomplete, heres the code.. this isn't working, what am i doing wrong here?
$.getJSON(url, function(data) {
//autocomplete
$(document).ready(function(){
$( "#name" ).autocomplete({
minLength: 2,
source: data
})
});
});
I know i can do source: url but i don't want to make multiple calls to the jSON data.
source: urlworks butsource: datadoesn't$(document).ready()wrapper function.