fix: wrap component injection in DOMContentLoaded guard
Cloudflare's email decode script was injecting into <head> and causing components.js to run before site-nav/site-footer elements existed in the DOM, leaving nav and footer blank on cPanel deployment. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -135,10 +135,17 @@
|
||||
</div>
|
||||
</section>`;
|
||||
|
||||
function inject() {
|
||||
var navEl = document.getElementById('site-nav');
|
||||
var footerEl = document.getElementById('site-footer');
|
||||
var processEl = document.getElementById('site-process');
|
||||
if (navEl) navEl.innerHTML = NAV;
|
||||
if (footerEl) footerEl.innerHTML = FOOTER;
|
||||
if (processEl) processEl.outerHTML = PROCESS;
|
||||
}
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', inject);
|
||||
} else {
|
||||
inject();
|
||||
}
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user