Popup Windows (Don't Do It!) - Web Team Procedures and Notes

This page is intended for use only by the Web Team.

Do not use popup windows on Ohlone College websites, unless it is truly necessary. Screen reader users and newbies to the Web find them difficult to use. It is sometimes appropriate to use them for web applications (such as help info on a page). Always tell the user a new window will popup.

Standards-Compliant New Window Links (aka popup windows)

Test of a completely accessible popup window with window size set:

  1. Best Option in most cases (because uses focus to bring new window in front of other windows):

    Ohlone College homepage (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 homepage (new window)</a>
  2. Good but doesn't focus new window:

    Ohlone College homepage (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 homepage (new window)</a>
  3. Good but relies on global javascript file never changing and always being linked to:

    Ohlone College homepage (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 homepage (new window)</a>
  4. Do not use this method (target attribute is deprecated):

    Ohlone College homepage (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 homepage (new window)</a>

References