A simple jQuery plugin to autocomplete a input text.
Dhiogo Boza - dhiogoboza@gmail.com
npm is used to build and test jquery-ajax-autocomplete
.
npm install
npm run build
Check dist
folder for compiled code
npm run test
Opens a browser window and run unit test. Check QUnit for details on how to write tests.
This plugins requests to a provided URL when the input text change. The reponse must be a json array with objects with id
and name
attributes.
$("YOUR_SELECTOR").autocomplete({
url: "data", // url to request json data
data: "type=locations", // additional data
onSelection: function (id, name) {
// event triggered when a option is selected
}
});