diff --git a/overrides/main.html b/overrides/main.html index dd2cc69c..3c2a0e29 100644 --- a/overrides/main.html +++ b/overrides/main.html @@ -13,16 +13,36 @@ document.write(``); } - //event - document.addEventListener('click', function (event) { - var target = event.target; - if (target.tagName === 'A') { - var href = target.getAttribute('href'); - if (href.startsWith('https://developers.amadeus.com')) { - event.preventDefault(); - window.location.href = href; + // Event listener for link clicks + window.addEventListener('DOMContentLoaded', (event) => { + document.body.addEventListener('click', function (event) { + var target = event.target; + if (target.tagName === 'A') { + var href = target.getAttribute('href'); + if (href.startsWith('https://developers.amadeus.com')) { + event.preventDefault(); + window.location.href = href; + } } - } + }); + }); + +{% endblock %} + +{% block scripts %} + {% endblock %} \ No newline at end of file