EPA uses jQuery as its main JS library. This library "sits" on top of JS and makes common tasks easier. When you write in jQuery, you're still writing JS, but what used to be 50 lines may now be one or two. All Drupal WebCMS content include the master jQuery file. You need not include it separately.
We provide a standard suite of JS files for everyone at the Agency to use. Linking to the EPA master JS files will improve your site performance, as users will cache a copy of the files. All JS, in content managed by the Drupal WebCMS, is output at the bottom of the HTML, just before the closing
</body> tag. Placing scripts here speeds up epa.gov for our readers. Area webmasters in the Drupal WebCMS can write JS, per page, as needed.
- Sometimes you'll see a website where everything has been done with JS: the HTML has been generated by JS, the CSS styling has been generated by JS, etc. This has all kinds of accessibility and other issues associated with it, so it is not advised.
- You should not use JS to create or modify styles for your content.
- JS for your application can go anywhere in the HTML; we recommend you output it at the bottom of the page or that you defer its loading.
- Functions first check to see if an object is available. If not, then fail silently
- If you offer advanced functionality and your pages cannot work the same way without JS:
- At a minimum, provide text equivalents.
- Provide a phone number or email address to get help.
About this Standard
All EPA public web content must adhere to the EPA Web Standards, the U.S. Web Design System guidelines, and the 21st Century Integrated Digital Experience Act.
Original effective date September 28, 2005
Last approved on: 02/12/2020
Web Council review by: 02/12/2023 (or earlier if deemed necessary by the Web Council)