Web Team Procedures and Notes
This page is intended for use only by the Web Team.
Standards-Compliant New Window Links (aka popup windows)
Test of a completely accessible popup window with window size set:
- BEST OPTION IN MOST CASES (because uses focus to bring new window in front of other windows):
Ohlone College home page (new window) (uses windowname, window.open(), and focuses popup window)
<a href="http://www.ohlone.edu/"
target="newWindow2"
onclick="var w=window.open(this.href, this.target,
'width=400,height=400,scrollbars=yes,resizable=yes');
w.focus();
return false;">Ohlone College home page (new window)</a> - Good but doesn't focus new window:
Ohlone College home page (new window) (uses windowname and window.open())
<a href="http://www.ohlone.edu/"
target="newWindow"
onclick="window.open(this.href, this.target, 'width=400,height=400,scrollbars=yes,resizable=yes'); return false"
>Ohlone College home page (new window)</a> - Good but relies on global javascript file never changing and always being linked to:
Ohlone College home page (new window) (uses windowname and function created in global JavaScript file; focus() is included)
<a href="http://www.ohlone.edu/"
target="newWindow3"
onclick="javascript:openwindow(this.href,this.target,'width=400,height=400,scrollbars=yes,resizable=yes');return false;">Ohlone College home page (new window)</a> - DO NOT USE THIS METHOD (target attribute is deprecated):
Ohlone College home page (new window) (uses deprecated target="_blank" attribute of <a> tag)
<a href="http://www.ohlone.edu/"
target="_blank"
onclick="window.open(this.href, this.target, 'width=400,height=400,scrollbars=yes,resizable=yes'); return false"
>Ohlone College home page (new window)</a>
References
- Read this: New-Window Links in a Standards-Compliant World
- all about window.open()
- evolt.org: Links & JavaScript Living Together in Harmony
- A List Apart: Accessible Pop-up Links
