I am using the following script that creates a popup alert box when a visitor clicks on a link that will leave the website (target=”_blank”). The dialog box opens correctly, and the “OK” button functions properly, however when you click on the red “X” box in the top right, it still sends the visitor to the link. How can I make the “X” just close the dialog box?
in <HEAD> section
<SCRIPT LANGUAGE=”JavaScript”>
<!– This script and many more are available free online at –>
<!– The JavaScript Source!! [url]http://javascript.internet.com
<!– Begin
function drawAlert () {
alert (“You are now leaving First Bank of Utica’s website. When you click on OK you will be transferred to a website that is not operated by our bank. First Bank of Utica is not responsible for the content on the alternate site. First Bank of Utica does not represent the third party or the member if the two enter into a transaction. Privacy and security policies of the alternate site may differ from those practiced at this bank.”);
}
// End –>
</SCRIPT>
In the <BODY> section as part of the href tag:
<a onClick=”drawAlert()” target=”_blank” href=”
Thanks in advance.