https://www.headline.co.uk/wp-content/themes/hachette-uk/client/js/modules/alert-notice.js?ver=1.2.0
1checkAlertNotice(); 2function checkAlertNotice() { 3 const alertNotice = document.getElementById('alert-notice'); 4 const alertBtn = document.getElementById('alert-btn'); 5 6 // Check if the required elements exist 7 if (!alertNotice || !alertBtn) { 8 return; // Exit the function if elements are not found 9 } 10 11 const clicked = sessionStorage.getItem('img-btn-clicked'); // return null if not set 12 if (clicked) { 13 alertNotice.style.display = 'none'; // hides the alert-notice 14 } else { 15 // add an event listener for button click 16 alertBtn.addEventListener('click', saveClicked); 17 } 18} 19 20function saveClicked() { 21 const alertNotice = document.getElementById('alert-notice'); 22 23 // Check if the alert-notice element exists 24 if (!alertNotice) { 25 return; 26 } 27 28 // set a flag in session storage that button is clicked 29 sessionStorage.setItem('img-btn-clicked', 'true'); 30 alertNotice.style.display = 'none'; // hides the alert-notice after click event 31}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.