Hi all I know there is a few results on this topic but I am not trying to do anything too advanced just yet trying to understand the basics. For some reason this code the alert works and prints out the correct array information but I can't seem to get it working for the autocomplete? https://jqueryui.com/autocomplete/
var oReq = new XMLHttpRequest(); //New request object
oReq.onload = function() {
var res = oReq.responseText;
AC(res);
};
oReq.open("get", "get-data.php", false);
oReq.send();
function AC(res){
$(function() {
alert(res);
$( "#tags" ).autocomplete({
source: res
});
});
}
so the alert(res) is working in function AC() but it's still not populating the source?
my get-data.php looks like this
<?php $arr = array("ActionScript",
"AppleScript",
"Asp");
echo json_encode($arr); ?>
I'd appreciate any guidance even if I have to look up more