The 'keep me posted' button reveals a slide-down panel which allows visitors to enter their email address to subscribe to emails using the GovDelivery service. The following process determines how it appears:
- The page template loads
govdelivery.js
. For example, on WebForms pagesdesktop.master
loadsscriptsdesktop.ascx
, which specifies theEmail
script, which resolves togovdelivery.js
inweb.config
. It loads thegovdelivery-button-*.css
files by a similar method. govdelivery.js
checks that it is on the https protocol on one of its approved domains. If so, it inserts the 'Keep me posted' button in the header. This picks up the CSS already loaded.- When the 'Keep me posted' button is clicked, it makes a request for
govdelivery.html
, inserts it into the page, and slides down the panel to reveal it. However, this request is intercepted byCorsForStaticFilesHandler
which is registered inweb.config
to handle*.html
requests in thecontrols
folder.CorsForStaticFilesHandler
checks the origin of the request against a list of approved domains inweb.config
and, if there is a match, inserts the appropriate CORS header. This allows the request to succeed across different domains and subdomains. govdelivery.html
has a form which posts to the GovDelivery site, at which point that service takes over.