Skip to content

Instantly share code, notes, and snippets.

@merovingienne
merovingienne / autocomplete.js
Last active February 24, 2018 17:04
Materialize Autocomplete with AJAX
/*
* @function ajaxAutocomplete
* Creates an autocomplete dropdown
* from content fetched via AJAX calls.
*
* @param {Object} options
* Used to pass options to the function
* options.ajaxURL = URL for the AJAX call
* options.inputId = Input field to use for autcompletion
* options.minLength = Minimum char length to start making AJAX calls.