Skip to content

Instantly share code, notes, and snippets.

@artpolikarpov
Created February 14, 2014 12:44
Show Gist options
  • Save artpolikarpov/9000389 to your computer and use it in GitHub Desktop.
Save artpolikarpov/9000389 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
$('.js-aims').each(function () {
var $this = $(this);
$this.on($this.data('aimEvent') || 'click', function () {
setAim($this.data('aim'));
});
});
});
<form id="checkout_form" class="js-aims" data-aim="SOME_SUBMIT_AIM" data-aim-event="submit">
<!-- ...-->
</form>
<button class="js-aims" data-aim="NORMAL_CLICK_AIM"></button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment