Quote:
Originally Posted by kh99
Well you can do something like:
HTML Code:
<a onclick="return confirm('Danger! You are going away now.\n\nAre you sure?')" href="http://cnn.com">Dangerous Site</a>
and it will pop up one of those "OK Cancel" boxes. But that's the easy part, I think. It's a little harder to figure out how to get it in to any link someone posts.
|
thanks but the code must encapsulate all information in postbit and detect foreign urls from my url. I do not want to warn people going to other urls on my own website.
here's a piece of generic code I found, but it warns on every click and I need to somehow modify it so that it can determine the destination domain, then compare it to my domain and only show the message of the domain names are different.
PHP Code:
<script>
window.onbeforeunload = function (evt) {
var message = ‘Are you sure you want to leave?’;
if (typeof evt == ‘undefined’) {
evt = window.event;
}
if (evt) {
evt.returnValue = message;
}
return message;
}
</script>