Skip to content

Instantly share code, notes, and snippets.

@cooncesean
Created June 4, 2014 20:03
Show Gist options
  • Save cooncesean/eda31e349d2ab5806f75 to your computer and use it in GitHub Desktop.
Save cooncesean/eda31e349d2ab5806f75 to your computer and use it in GitHub Desktop.
Front End Challenge
<html>
<body>
<!-- This is the search input -->
<input type="text" id="search" placeholder="Search For Something..." />
<!-- Results go here -->
<ul id="results" ></ul>
</body>
</html>
{
'results': [
{'name': 'Elaine', id:'1001', url:'/elaine/'},
{'name': 'George', id:'1032', url:'/george/'},
{'name': 'Jerry', id:'982', url:'/jerry/'},
{'name': 'Kramer', id:'12', url:'/kramer/'},
],
'count': 4,
'page': 1
}

Build me an auto-completer using the dom elements in the html file and assuming a dictionary of results represented in the json file.

The auto-completer should:

Capture key presses in the text input and send async calls to the server sending the value of the input as the search term. The results from each async request should be processed and used to update the element. Feel free to modify the dom or the results if you feel we need more data or more specific selectors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment