fix TypeError on obsolete_browser_alert innerHTML access

Add null check before accessing innerHTML, since the element may not
exist in the DOM when the CMS renders the page.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Mark Eaton
2026-02-23 10:26:38 -05:00
co-authored by Claude Opus 4.6
parent 9afd7790a1
commit a272b054ad
+2 -1
View File
@@ -36,7 +36,8 @@
// Display warning if ES6 detection failed // Display warning if ES6 detection failed
window.onload = function () { window.onload = function () {
if (window.isES6 == false) { if (window.isES6 == false) {
document.getElementById("obsolete_browser_alert").innerHTML = var alertEl = document.getElementById("obsolete_browser_alert");
if (alertEl) alertEl.innerHTML =
'<div class="alert alert-danger" role="alert" style="text-align: center;"><strong>WARNING! Unsupported browser!</strong><br />It looks like you\'re using an old browser.<br />This website works best with modern browsers such as the latest versions of Chrome, Firefox, Safari, and Edge.<br />If you continue with this browser, many parts of this site will not work and you will see unexpected results.</div>'; '<div class="alert alert-danger" role="alert" style="text-align: center;"><strong>WARNING! Unsupported browser!</strong><br />It looks like you\'re using an old browser.<br />This website works best with modern browsers such as the latest versions of Chrome, Firefox, Safari, and Edge.<br />If you continue with this browser, many parts of this site will not work and you will see unexpected results.</div>';
} }
}; };