Coder Social home page Coder Social logo

library-app's Introduction

Let's go to the library!

Your challenge is to build a site with the following user stories:

  1. When I open the page, I see a simple form that consists of a text input and a submit button: user story 1
  2. When I enter a genre keyword and submit, I see the title, author, and cover of a random book from that genre: user story 2
  3. If the genre keyword is invalid for any reason (note that this API cannot handle spaces in search terms), I see an error message: user story 3

Baby steps

  • Build out your html. Use a <form> element so we can just hit enter to search.
  • Add a submit event listener to your form that grabs the value from the input field.
  • Make a request to get data on the books in that genre. Use this api: https://openlibrary.org/developers/api. (You'll have to read their documentation to figure out how to search by subject!) Log the response that you get to confirm that it works.
  • Pick a random book out of the array of books that you get from the API search.
  • Append the data to the DOM. You'll need to look at the API documentation on book covers to figure out how to do this, it takes some tricky navigation!
  • Handle errors, using .catch() if you are using .then() or try {} catch () {} if you are using async/await.

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.