If using “defer” to load jQuery

This article was created when Ver 2.0.7.3 was released.

QA Heatmap Analytics utilizes jQuery which is registered with WordPress to perform the measurement.
Therefore, you need to load the QA JS file after loading jQuery.

If you have a “defer” in the script tag to load ‘jquery,’ this order will be affected.
As a result, the measurement may not work properly, causing “no data” or “the heatmap does not show up even though the number of data is there”.
In addition, it cannot be denied that JS errors may occur and affect other plugins.

To avoid this, you will need to take one of the following actions.

  • Do not add “defer” to ‘jquery’.
  • Add JS files of QA Heatmap Analytics (under the directory ‘qa-heatmap-analytics/js’) to the target to be “defer”, which would be written in ‘functions.php’, etc.

> Other sites for reference (in Japanese)
WordPress, async and defer to slow down the loading of JavaScript.
Scripts: async, defer
If I write more than one “script defer”, can I guarantee the execution order?
How to find out the handle names of JavaScript and CSS that are added by plugins

Was this article helpful?