From fcb97cb2e7043547a7e830ad14c256b23517104c Mon Sep 17 00:00:00 2001 From: Matthew Gold Date: Wed, 15 May 2024 08:06:59 -0400 Subject: [PATCH] Use anonymous function for onError callback to prevent immediate execution of the function. --- best-cigars-guide/scripts/delayed.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/best-cigars-guide/scripts/delayed.js b/best-cigars-guide/scripts/delayed.js index 6f8e378..943be6f 100644 --- a/best-cigars-guide/scripts/delayed.js +++ b/best-cigars-guide/scripts/delayed.js @@ -31,7 +31,7 @@ function loadGoogleAnalytics() { document.head.appendChild(tag); // Configuration script tag.onload = onGALoad; - tag.onerror = onError('Google Analytics'); + tag.onerror = () => onError('Google Analytics'); } // Check if Google Analytics is loaded