External Link Notification
JS notification when an external link is clicked.
by SullysRants
HTML
<!-- Example for http://stackoverflow.com/a/21540096/1590427 -->
<a href="http://stackoverflow.com/a/21540096/1590427" target="_blank">Stack Overflow Answer</a>
JavaScript
$(document).ready(function() {
return this.hostname && this.hostname !== location.hostname;
}).click(function(e) {
if (!confirm("You are about to proceed to an external website.")) {
// if user clicks 'no' then dont proceed to link.
e.preventDefault();
};
});