Skip to content

Instantly share code, notes, and snippets.

@dmitryshimkin
Last active August 29, 2015 14:09
Show Gist options
  • Select an option

  • Save dmitryshimkin/8324cd6ee079aad34221 to your computer and use it in GitHub Desktop.

Select an option

Save dmitryshimkin/8324cd6ee079aad34221 to your computer and use it in GitHub Desktop.
var gotData = function (request) {
if (request.params.query === someField.value) {
resultList.innerHTML = request.data.map(function (item) {
return '<li>' + item.text + '</li>';
});
}
}
someField.onkeyup = function () {
var query = someField.value;
request('/some/url?query=' + query, {
query: query
}).then(gotData);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment