I’m trying to have jQuery autocomplete point to a PHP file (which gathers data from MySQL).
First I tried it with sample data from a Javascript array and it worked:
var tags = ["a", "ab", "abc", "abcd", "adbce"];
$("input#name").autocomplete({
position: {
offset: "0 -10px",
},
source: tags
});
But when I point to a file which returns data in JSON format (following the official documentation) it doesn’t work. I thought it was a problem in the PHP, but when I checked firebug it turned out the request is never being sent in the first place
This is the code I’m using:
$("input#name").autocomplete({
position: {
offset: "0 -10px",
},
source: "http://absolutepathtofile/autosuggest.php"
});
And the screenshot from firebug (homepage.js is the file which contains the autocomplete code above):

I can provide the PHP code but I don’t think it really matters since the problem should be in Javascript – let’s say I am using this test code in autosuggest.php:
$array[0]="test";
$array[1]="test1";
echo json_encode($array);
Anyone know what’s wrong here?
Your
nettab in the screenshot is pointing toJSrequests, it should point toXHRrequests.