-
-
Save tommcfarlin/61bd05c60b40d9f3ecd9eb81e5cb3f86 to your computer and use it in GitHub Desktop.
[jQuery] The Why and How of Custom jQuery Events
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
$button.on('click', function(evt) { | |
evt.preventDefault(); | |
$(document).trigger('acme.ajax.processing'); | |
$.get(ajaxurl, { | |
// Your action and security measures here. | |
}, function(response) { | |
// Your response behavior here. | |
}) | |
.done(function() { | |
$(document).trigger('acme.ajax.complete'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment