U.S. Department of Energy - Energy Efficiency and Renewable Energy

EERE Communication Standards & Guidelines

Scripts, Applets, and Dynamic Pages

This page describes the requirements for developing scripts, applets, and dynamic pages on the EERE Web site. The use of scripting allows the creation of dynamic Web sites that allow user interaction.

General

  • Make sure that every script works in the standard browser set.
  • Make sure scripting does not alter the intended functionality of the "Back" button, which people use frequently to back out of pages.

Cookies

In June 2000, the Office of Management and Budget (OMB) issued a memo outlining policy on cookies on federal government Web sites.

There are two types of cookies:

  • Session cookies, which expire when the user closes the browser at the end of an online session
  • Persistent cookies, which are stored on a user's computer and which expire after a specific time period

OMB's privacy policy specifically prohibits persistent cookies unless agencies meet the following criteria:

  • Demonstrate a compelling need to collect the information
  • Gain the approval of the agency's top official
  • Have appropriate safeguards for protecting the stored data
  • If you obtain permission, users must be notified that persistent cookies are being used. Agencies can use session cookies without notifying users.

Section 508 Accessibility Requirements

When pages utilize scripting languages to display content or to create interface elements, the information provided by the script needs to be made available to assistive technologies.

At this time, many elements of Dynamic HTML (client-side scripted HTML, which is usually accomplished through Javascript) cannot be made directly accessible, especially when onMouseover (or similar) commands are used. A prime example is the use of drop-down menus, which use onMouseover event to cause the menus to appear.

If an onMouseover (or similar) element does not contain any important information (e.g., the script causes a button to "glow"), then there is no consequence for accessibility. If this scripted event reveals important information, a keyboard-accessible alternative is required.

In cases where a script cannot be made directly accessible, a text-only page, with equivalent information or functionality, can be provided to make a Web site comply with 508 standards, when compliance cannot be accomplished in any other way. The content of the text-only page must be updated whenever the primary page changes. This is the option of last resort. Sites must do their best to provide an equivalent experience for all users.

Pop-Up Windows

Avoid the use of pop-up windows or new browser windows. This technique causes confusion for those using screen readers by introducing a sudden change of focus and loss of orientation. Normal forms of navigation such as the back button no longer function as expected.

If you do use a pop-up window, you must tell your users that the link opens in a new window. This can be part of hyperlink text or written into alt text.

Applets and Plug-Ins

When a Web page requires that an applet, plug-in, or other application be present on the client system to interpret page content, the page must provide a link to an accessible page where the plug-in can be downloaded.

All Java applets, scripts, and plug-ins (including Flash, Shockwave, PowerPoint, Acrobat PDF, Quicktime, RealPlayer, and Windows Media Player) and the content within them should be accessible to assistive technologies, unless an alternative means of accessing equivalent content is provided.

Timed Responses

When a timed response is required, the user shall be alerted and given sufficient time to indicate more time is required.