Skip to content

Instantly share code, notes, and snippets.

@jaan
Forked from elijahmanor/dont-do-this-at-home.js
Created March 9, 2014 08:06
Show Gist options
  • Save jaan/9444327 to your computer and use it in GitHub Desktop.
Save jaan/9444327 to your computer and use it in GitHub Desktop.
// Please, please, please don't try this at home
$(document).ready(function() {
$("a.meatloaf").on("click", function(e) {
// Once upon a time, there was a developer...
e.preventDefault(); // Prevent the default behavior
e.stopPropagation(); // Not working like expected, so stop it
e.stopImmediatePropagation(); // No really, stop it
return false; // Just in case... STOP IT!
// Moral of story: Know what each of the above statements mean
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment