Standard: Javascript
On this page
All standards and guidance
Definitions
JavaScript is a scripting language carried out by the browser. It can validate form entries, open new windows, detect user actions (such as individual keystrokes), or retrieve data from the server without interfering with the display or behavior of the open web page. JavaScript is not Java, a separate programming language.
Top of page
Content requirements
- Web pages aren't dependent on JavaScript to work: it is an enhancement
- Functions first check to see if an object is available. If not, then fail silently.
- HTML and JavaScript are separated--little or no inline event handlers.
- With JavaScript off, nothing happens--
- Does not rely on browser specific extensions.
- Do not rely on JavaScript for critical functions
- For example, if form entries must be validated before they go into a database, carry out that function on the server.
- Pages must work the same way without JavaScript enabled. At minimum, provide
- the same information and navigation options whether JavaScript is enabled or not
- a phone number or email address to get help
Top of page
Examples
- If you provide a calculator written in JavaScript, also provide a plain-text page explaining how users can complete a calculation manually with a formula or algorithm.
- Drop-down menus made out of HTML lists and enhanced with JavaScript are allowed.
- "Instant Selection boxes" are not allowed. When JavaScript is disabled, there's no way to jump to the chosen page. Instead, use a normal HTML form selection box that requires pressing a button (e.g., marked "go")
Top of page
Rationale
JavaScript can enhance the appearance and functionality of a Web page. However, JavaScript is not well supported by all browsers (many screen readers are unable to parse JavaScript well), and some readers disable it for security or other reasons.
Top of page
Related governance documents
EPA
Related Policies
Related Procedures
Related Standards
Related Guidance
Non-EPA
Top of page
Full Metadata about this standard
Name Javascript
Tracking number NT00000000
Type Standard
Required or Recommended Required
Effective date 09/28/2005
Date approved 09/28/2005
Category Scripts and Codes
Web Council review by 09/06/2008 (or earlier if deemed necessary by the Web Council)
Governing Policy Web Governance and Management (PDF) (4 pp, 339K, About PDF)
Top of page