Skip to content

Instantly share code, notes, and snippets.

Created October 7, 2016 19:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
var aladdin = document.querySelector(".aladdin");
var terminator = document.querySelector(".terminator");
aladdin.addEventListener("click", getMovie);
terminator.addEventListener("click", getMovie);
// ...and so on for each movie
// One event handler to rule them all...
function getMovie(event) {
var clickedMovie =;
var imdbID =;
var url = "" + id;
$.get("", displayResults);
function displayResults(results) {
// Update the table...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment