Is it possible in jQuery to have a link, when clicked, have an intermediate event occur? For example, a very short video is played before going to the link’s primary target. I know I would most likely have to use .preventDefault() on the link for the first event, but how would I have the default action occur after the intermediate step?
Share
You would need to bind to the window’s beforeunload property like so:
EDIT: Be sure to capture in your code if it’s coming from that link or not.