// Ad server URL constant const BANNER_URL = '/get'; /** * Function to load and display the banner */ async function loadBanner() { const bannerElement = document.getElementById('banner'); const zone = bannerElement.getAttribute('nexus-zone'); try { // Send GET request to ad server const response = await fetch(BANNER_URL + "?zone=" + zone, { method: 'GET', headers: { 'Accept': 'text/html' } }); // Check if request was successful if (!response.ok) { throw new Error(`HTTP Error: ${response.status}`); } // Get banner HTML code const bannerHTML = await response.text(); // Insert HTML code into banner container bannerElement.innerHTML = bannerHTML; // Execute scripts from loaded HTML (if any) executeScripts(bannerElement); } catch (error) { console.error('Banner loading error:', error); bannerElement.innerHTML = `