I\'m jQuery beginner trying to make jQuery UI Autocomplete get data from txt file. Txt format is simple:
user1
user2
user3
etc.
From the documentation:
Source
An Array of Strings:
[ "Choice1", "Choice2" ]An Array of Objects with label and value properties:
[ { label: "Choice1", value: "value1" }, ... ]
You need to amend your text file to be in this format:
["user1","user2","user3"]
Then change your jQuery to this:
$( "#userLogin" ).autocomplete({
source: 'users.txt'
});