/* ----------------------------------------- MBC CUSTOM JS - Header Include ----------------------------------------- */ // check for function isSkippedImports() { const metaTag = document.querySelector('meta[name="skip-template-imports"]'); return metaTag !== null && metaTag.getAttribute('content') === 'true'; } if (!isSkippedImports()) { // if not skipped, append CSS and JS to the head const head = document.head; // CSS files const cssFiles = [ `https://www.mbc.ca.gov/bundles/css` ]; cssFiles.forEach(href => { const link = document.createElement('link'); link.rel = 'stylesheet'; link.href = href; head.appendChild(link); }); // JS files const jsFiles = [ 'https://www.mbc.ca.gov/bundles/libs', 'https://www.mbc.ca.gov/bundles/js' ]; jsFiles.forEach(src => { const script = document.createElement('script'); script.src = src; head.appendChild(script); }); } // create header element const mbcHeader = document.createElement('header'); mbcHeader.setAttribute('role', 'banner'); mbcHeader.id = 'header'; mbcHeader.className = 'global-header fixed hide-print'; // header content const mbcHeaderContent = `