I have a website that requires the user must be warned anytime they are leaving the site. After presenting the warning with a popup, the user needs to have the option to click "OK" or "Cancel". The link needs to open in a new window.
I have this working except when the user clicks cancel, it keeps the open window and is blank. I need to get it set so the message occurs first before opening the new tab/window or the new tab/window closes when the user clicks cancel.
If you want to see this in action, the preview link is http://provincial.ensemblecreative.com/Investment.cfm
Here is the code I have so: