This event is emitted when a link is followed through Unpoly.
The event is emitted on the <a>
element that is being followed.
Listeners may inspect and manipulate render options for the coming fragment update.
The code below will open all form-contained links in an overlay, as to not lose the user's form data:
up.on('up:link:follow', function(event, link) {
if (link.closest('form')) {
event.renderOptions.layer = 'new'
}
})
The link element that will be followed.
An object with render options for the coming fragment update. Listeners may inspect and modify these options.
Event listeners may call this method to prevent the link from being followed.