Skip to content

Instantly share code, notes, and snippets.

@darrellpratt
Created May 25, 2016 17:08
Show Gist options
  • Save darrellpratt/61142633bc343110b7348dc65880493b to your computer and use it in GitHub Desktop.
Save darrellpratt/61142633bc343110b7348dc65880493b to your computer and use it in GitHub Desktop.
// Code uses jQuery to illustrate the Pyramid of Doom
(function($) {
$(function(){
$("button").click(function(e) {
$.get("/test.json", function(data, textStatus, jqXHR) {
$(".list").each(function() {
$(this).click(function(e) {
setTimeout(function() {
alert("Hello World!");
}, 1000);
});
});
});
});
});
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment