You are here: irt.org | FAQ | JavaScript | Window | Q1624 [ previous next ]
Try:
<html> <body onLoad="leaving=true" onUnload="if (leaving) window.open('popup.htm','windowName');"> <a href="localLink.htm" onClick="leaving=false">Local link</a> <a href="http://otherdomain.com/alsoMyLink.htm" onClick="leaving=false">Link on my domain</a> <a href="http://othersite.com/notMyLink.htm">Link to an external site - popup triggered</a> also forms can be submitted without the popup: <form onSubmit="leaving=false"> </form> </body> </html>