diff --git a/assets/js/script.js b/assets/js/script.js index d13ac13..841dbee 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -296,7 +296,8 @@ initServerLocations(); // fetch live server availability const params = new URLSearchParams(window.location.search); ["source", "medium", "campaign", "term", "content"].forEach(function (key) { const val = params.get("utm_" + key); - if (val) document.getElementById("utm_" + key).value = val; + const el = document.getElementById("utm_" + key); + if (val && el) el.value = val; }); })(); @@ -754,9 +755,10 @@ function updateCouponBadges() { } }); } -document - .getElementById("pricing-coupon") - .addEventListener("input", updateCouponBadges); +const pricingCoupon = document.getElementById("pricing-coupon"); +if (pricingCoupon) { + pricingCoupon.addEventListener("input", updateCouponBadges); +} /* ── Blog ──────────────────────────────────────────────── */ const BLOG_POSTS_PER_PAGE = 6;