Opening Popup Windows With No Extra Markup
By Thierry Kiblentz2001-08-31
Doing the Windows
A little recap about the most common ways to popup Windows (with their caveat):
<a href="http://validator.w3.org/" target="_blank">W3C Validator</a>
- The user may have no choice other than to open the page in a new window.
- The target value does not name the window and thus this link will spawn multiple popups.
- Depending on the DTD used, target ** may not be allowed here.
- There is no separation of structure and behavior.
** As a side note, using a Custom DTD Declaration is a solution that "passes" the Markup Validator, but - as far as I know - not the CSS Validator. <a href="#" onclick="window.open("http://validator.w3.org");return false;">W3C Validator</a>
or
<a href="Javascript:window.open('http://validator.w3.org');void(0)">W3C Validator</a>
- The user may have no choice other than to open the page in a new window.
- The user cannot open the link in a new tab or window (using browser's built-in features).
- The window is not named and thus this link will spawn multiple popups.
- The page is not accessible in JS -challenged UA s or if Javascript is disabled.
- There is no separation of structure and behavior.
<a href="http://validator.w3.org" onclick="window.open(this.href);return false;" onkeypress="window.open(this.href);return false;">W3C Validator</a>
- If there is Javascript support, the user may have no choice other than to open the page in a new window.
- The window is not named and thus this link will spawn multiple popups.
- The redundant mechanism ( onclick/onkeypress ) is part of the WAI guidelines ( checkpoint 9.3 ), but it will make tabbing navigation impossible in some browsers.
- There is no separation of structure and behavior.
Tutorial Pages:
» Opening Popup Windows with no extra markup
» Doing the Windows
» Standards-Compliant Popups
» Popups for External Links
» Custom Popups for specific links
Copyright TJKDesign
