
20 February 2019, Creative Technology
A “suggest-as-you-type” search widget in 57 lines of JavaScript code.
A how-to for an effective search widget that shows suggestions as you type, in plain JavaScript, and using the Fetch API to GET content.
While developing Influen$e, I wanted to make the search function a bit more robust for people searching for an influencer's Instagram account by name.
Because discovery is a critical distinguishing feature of Influen$e, I also wanted to build in a simple recommendation function that targeted customers based on the relevance of influencers' content to their core brand values.
In this article, I'll share the code and walk you through how the function works.
Let's begin
We'll start with our search form. It looks like this:
Got something that needs making?
I take on new work through Alucrative, the applied AI studio I run with a small crew of people I trust. Tell us what you’re trying to do and we’ll tell you honestly whether AI belongs in it.