You are here: irt.org | FAQ | JavaScript | Window | Q1725 [ previous next ]
Instead of using the window object's open() method in the href attribute, use the onClick event handler instead. If you return false from the onClick event handler then the default action of the click event (i.e. load the url specified by the href attribute) is cancelled:
<a href="default.htm" onClick="window.open('popup.htm','windowName','width=200,height=200');return false;">click</a>