Confirming a Link Click with jQuery
Here's a function I wrote while working on a project that pops up a box confirming whether or not the user is sure the want to go to a link they clicked, like this.
It may be simple, but I haven't really used javascript's confirm() function much in the past and everything I found only directed the user to a link predefined in the function. I wanted a function that would confirm any link I wanted it to without knowing the link destination in advance, in other words I wanted to confirm dynamic links.
The Code
This jQuery function will pop up a confirmation box on any link with the class confirm
and send the user to the destination of that link if they click 'OK'.