Giter Club home page Giter Club logo

auto-complete's Introduction

Background & Objectives

This is our second AJAX exercise. We will build an input with autocomplete capability. What's that? Head out to Google for an example: as soon as you type one character in the input field, you get autocomplete suggestions underneath.

We want to build an autocomplete input with Dictionary words.

Specs

Launch your local webserver with:

serve

There are three files you need to update:

  • index.html - the input is already in place but there are some dummy elements in the autocomplete ul that you can remove
  • style.css - add some style
  • lib/index.js - you'll start here from scratch!

To get suggestions, you can use the following API:

GET https://wagon-dictionary.herokuapp.com/autocomplete/:stem

Here, you will replace :stem with the characters typed by the user. As soon as the user enters a new character (keyup maybe?), you will trigger a new AJAX call. If you look at your "Network" tab in Chrome Inspector you should see something like this:

https://wagon-dictionary.herokuapp.com/autocomplete/u
https://wagon-dictionary.herokuapp.com/autocomplete/un
https://wagon-dictionary.herokuapp.com/autocomplete/und
https://wagon-dictionary.herokuapp.com/autocomplete/unde
https://wagon-dictionary.herokuapp.com/autocomplete/under
etc.

When you receive the JSON from the API, your job is to update the ul#results list with suggestions!

Once you have the basic behavior, don't hesitate to try and make the ul#results look ๐ŸŽจ really good ๐ŸŽจ ๐Ÿ˜‹

auto-complete's People

Contributors

nhv33 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.