Skip to content

Commit

Permalink
Use anonymous function for onError callback to prevent immediate exec…
Browse files Browse the repository at this point in the history
…ution of the function.
  • Loading branch information
codecodeio committed May 15, 2024
1 parent aad4b68 commit fcb97cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion best-cigars-guide/scripts/delayed.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fcb97cb

Please sign in to comment.