Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// Assuming there's an <img class="aladdin"> on the page...
var aladdin = document.querySelector(".aladdin");
aladdin.addEventListener("click", getAladdin);
// You'll have multiple event handlers...
function getAladdin(event) {
$.get("", displayResults);
// ...but only one AJAX callback
function displayResults(results) {
// Update the table...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment