###* Events ====== Most Unpoly interactions emit DOM events that are prefixed with `up:`. $(document).on('up:modal:opened', function(event) { console.log('A new modal has just opened!'); }); Events often have both present ([`up:modal:open`](/up:modal:open)) and past forms ([`up:modal:opened`](/up:modal:opened)). You can usually prevent an action by listening to the present form and call `preventDefault()` on the `event` object: $(document).on('up:modal:open', function(event) { if (event.url == '/evil') { // Prevent the modal from opening event.preventDefault(); } }); A better way to bind event listeners ------------------------------------ Instead of using jQuery to bind an event handler to `document`, you can also use the more convenient [`up.on`](/up.on): up.on('click', 'button', function(event, $button) { // $button is a jQuery collection containing // the clicked