Skip to content
Coastal Healthcare Advocates

JavaScript reference

This reference covers the Coastal Healthcare Advocates site scripts. It is generated from the JSDoc comments in src/js/ every time npm run build runs, so edit those comments, not these pages. Each source file is minified into assets/js/ by scripts/build-js.js, and the Style guide links here. The stylesheet has its own CSS reference.

File How it loads Where
theme Classic, render-blocking <script> in <head> Every page
email Classic <script defer> in <head> Every page
sound Classic <script defer> in <head> Every page
consent <script type="module"> Every page
secondary Classic <script> at the end of <body> Secondary pages
main <script type="module"> index.html
modal <script type="module"> index.html
contact-form Imported by modal.js, and initialises the inline form itself index.html

The classic scripts are ES5 inside an IIFE. Their functions are private, but they're listed on each module's page as inner members all the same.