From d225216e78be4c4398dc2c1cfd04643c9347e144 Mon Sep 17 00:00:00 2001 From: bosco-ensemble Date: Tue, 9 Apr 2024 10:13:34 -0700 Subject: [PATCH] TDW-2277 lint fix --- scripts/scripts.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/scripts.js b/scripts/scripts.js index 00eceab9..1af9d56d 100644 --- a/scripts/scripts.js +++ b/scripts/scripts.js @@ -1072,7 +1072,7 @@ async function loadLazy(doc) { window.setTimeout(async () => { // eslint-disable-next-line no-use-before-define - await loadAds(doc); + await loadAds(); }, 1000); } @@ -1198,7 +1198,7 @@ async function OptanonWrapper() { await sendAnalyticsPageEvent(); } -async function loadAds(doc) { +async function loadAds() { const placeholders = await fetchPlaceholders(); const isProd = window.location.hostname.endsWith(placeholders.hostname); @@ -1215,7 +1215,7 @@ async function loadAds(doc) { const gtmId = placeholders.googletagmanagerId; if (gtmId) { - const GTMScript = doc.createElement('script'); + const GTMScript = document.createElement('script'); GTMScript.innerHTML = `(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= @@ -1223,7 +1223,7 @@ async function loadAds(doc) { })(window,document,'script','dataLayer','${gtmId}');`; document.head.append(GTMScript); - const GTMFrame = doc.createElement('no-script'); + const GTMFrame = document.createElement('no-script'); GTMFrame.innerHTML = ``; document.body.prepend(GTMFrame);