Confirm redirect (Javascript)
by spyka (http://www.spyka.net)
This code asks users to confirm that they want to continue before being redirected to another website or page.
Place the first part in the <head></head> tags and use the second part to link to the snippet.
<!-- Place in <head></head> tags -->
<script type="text/javascript">
function con_redir(url) {
var msg = 'Are you sure you want to continue?' // Message to users
if(confirm(msg)) {
location.href=url;
}
}
</script>
<!-- Example usage -->
<a href="javascript:con_redir('http://www.google.com')">Go to google.com</a>