If all my dire warnings the other day didn’t scare you off, and after careful consideration you’ve found yourself with a compelling enough reason to open a new window — compelling enough that your users will expect a window to open, which I think is quite a rare situation — please don’t use the old HTML
For one thing, the
target does have a structural meaning and so is included in the XHTML 1.0 Frameset DTD. But you’re not using frames, are you?
If you find yourself in a position where you have no choice but to open a new window, please don’t do this:
do this instead:
<a href="new.html" onclick="openWindow(this.href); return false;">new window</a>
(This assumes that you’ve defined an
Thank you. You’ve just made the Web a better place.
You’d make it an even better place if you never opened new windows in the first place.
Update: Paul Sowden wrote to point out although Mozilla allows the blocking of
It’s possible to disable all window-opening behavior in Mozilla, by the way. Add this line to your user preferences file:
You’ll still be able to open windows if you want to, but it won’t happen without your permission.
This and other goodies are documented on or near the end-user documentation on the Mozilla site (Customizing Mozilla, Hidden Mozilla Prefs).