This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = event.target; | |
var imdbID = clickedMovie.id; | |
var url = "http://omdbapi.com/?i=" + id; | |
$.get("http://omdbapi.com/?i=tt0103639", 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