Autocomplete with an API call

Autocomplete with an API call
0

#1

Anyone done this?
I have an auto complete field which is getting data from an API call.
(Note: I have saved the JSON to the file system as this data doesn’t change often)

So, I imagine the best way to do this is pre-populate the search list with an API call.

Then pre-load the JSON to a variable which will be available to the Autocomplete input box.

My other plan was to only search when the user types +3 chars.

I notice there are many plugins which do this including jQuery-Ui.

https://jqueryui.com/autocomplete/


#2

#3

So using Autocomplete is the best way?

I notice this will do an ajax call. Does this do this on every key press?
If so that does not seem very efficient.