Coder Social home page Coder Social logo

wd-ajax-hero's Introduction

Ajax Hero

In this exercise, you're tasked with extending a web application to make Ajax calls to the OMDb API and update the DOM. To get started, fork and clone this repository.

Search

The web application should allow the user to browse movies by search keywords.

More specifically, you'll need to extend the existing JavaScript with the following behavior.

  • Listen for submissions on the search form. Remember to prevent the default action.
  • Validate the user input is not blank.
  • Clear the previous search results.
  • Send an HTTP request to the OMDB API search endpoint.
  • Handle the HTTP response by pushing a new, well-formed movie object into the global movies array.
  • Render the movies array to the page by calling the renderMovies() function with no arguments.

Each well-formed movie object in the movies array must have the following key-value pairs.

Key Value
id The movie's unique imdb ID number.
poster The URL to the movie's poster image
title The title of the movie.
year The year of the movie's release.

Bonus

The web application should also allow the user to view a movie's full plot by clicking on the "Plot Synopsis".

While the application is handling the first HTTP response, you'll need to extend your JavaScript with the following behavior.

  • Use the movie's unique imdb ID to send an HTTP request to the OMDB API id endpoint.
  • Handle the HTTP response by pushing a new, well-formed JavaScript object into the global movies array.
  • Render the movies array to the page by calling the renderMovies() function with no arguments.

Each well-formed movie object in the movies array must have the following additional key-value pairs.

Key Value
plot The movie's full plot

wd-ajax-hero's People

Contributors

ryansobol avatar iansmith89 avatar jakebrbell avatar psithanant avatar

Watchers

James Cloos avatar  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.