My requirement is to display, via an overlay, a message informing the user they are leaving mywebsite.com and allow them to continue or cancel. This will only occur if the user is leaving the mywebsite.com site to go to an external site.
There are links to other websites in my website. Whenver a user navigates away from my website, a alert has to be displayed.
Is there any better option or sample code to do that.