diff --git a/core/.eslintrc.jquery.json b/core/.eslintrc.jquery.json index d19a0f550e9..b41547a39c7 100644 --- a/core/.eslintrc.jquery.json +++ b/core/.eslintrc.jquery.json @@ -38,7 +38,7 @@ "jquery/no-parse-html": 0, "jquery/no-prop": 0, "jquery/no-proxy": 0, - "jquery/no-ready": 0, + "jquery/no-ready": 2, "jquery/no-serialize": 0, "jquery/no-show": 0, "jquery/no-size": 2, diff --git a/core/modules/statistics/statistics.js b/core/modules/statistics/statistics.js index 7c0360dc7c0..32fd8757aef 100644 --- a/core/modules/statistics/statistics.js +++ b/core/modules/statistics/statistics.js @@ -3,8 +3,8 @@ * Statistics functionality. */ -(function ($, Drupal, drupalSettings) { - $(document).ready(() => { +(function ($, drupalSettings) { + setTimeout(() => { $.ajax({ type: 'POST', cache: false, @@ -12,4 +12,4 @@ data: drupalSettings.statistics.data, }); }); -})(jQuery, Drupal, drupalSettings); +})(jQuery, drupalSettings);