{"id":2092,"date":"2021-12-24T16:22:51","date_gmt":"2021-12-24T07:22:51","guid":{"rendered":"https:\/\/mem.quarka.org\/manual\/if-you-are-loading-jquery-as-a-defer\/"},"modified":"2022-12-15T18:44:51","modified_gmt":"2022-12-15T09:44:51","slug":"if-you-are-loading-jquery-as-a-defer","status":"publish","type":"ht_kb","link":"https:\/\/mem.quarka.org\/en\/manual\/if-you-are-loading-jquery-as-a-defer\/","title":{"rendered":"If using &#8220;defer&#8221; to load jQuery"},"content":{"rendered":"\n<p>QA Analytics utilizes jQuery, which is registered with WordPress, for measurement.<br\/>Therefore, you need to load the QA JS file after loading jQuery.<\/p>\n\n<p>If you have a &#8220;defer&#8221; in the script tag to load &#8216;jquery,&#8217; this order will be affected.<br\/>As a result, the measurement may not work properly, causing &#8220;no data&#8221; or &#8220;the heatmap does not show up even though the number of data is there&#8221;.<br\/>In addition, it cannot be denied that JS errors may occur and affect other plugins.<\/p>\n\n<p>To avoid this, you will need to take one of the following actions.<\/p>\n\n<ul><li>Do not add &#8220;defer&#8221; to &#8216;jquery&#8217;.<\/li><li>Add QA Analytics (under the qa-heatmap-analytics\/js directory) to the target of js files that defer written in functions.php, etc.<\/li><\/ul>\n<p>&gt; Other sites for reference (in Japanese)<br\/>&#8211; <a rel=\"noreferrer noopener\" href=\"https:\/\/tadtadya.com\/wordpress-late-load-js-async-defer\/\" target=\"_blank\">WordPress, async and defer to slow down the loading of JavaScript. <\/a><br\/>&#8211; <a href=\"https:\/\/ja.javascript.info\/script-async-defer\" target=\"_blank\" rel=\"noreferrer noopener\">Scripts: async, defer<\/a><br\/>&#8211; <a rel=\"noreferrer noopener\" href=\"https:\/\/ja.stackoverflow.com\/questions\/28536\/script-defer%E3%82%92%E8%A4%87%E6%95%B0%E8%A8%98%E8%BF%B0%E3%81%97%E3%81%9F%E5%A0%B4%E5%90%88-%E5%AE%9F%E8%A1%8C%E9%A0%86%E5%BA%8F%E3%81%AF%E4%BF%9D%E8%A8%BC%E3%81%95%E3%82%8C%E3%82%8B%E3%81%A7%E3%81%97%E3%82%87%E3%81%86%E3%81%8B\" target=\"_blank\">If I write more than one &#8220;script defer&#8221;, can I guarantee the execution order?<\/a><br\/>&#8211; <a rel=\"noreferrer noopener\" href=\"https:\/\/affiliate150.com\/handle-name\" target=\"_blank\">How to find out the handle names of JavaScript and CSS that are added by plugins<\/a><\/p>\n","protected":false},"author":1,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0},"ht_kb_category":[334],"ht_kb_tag":[],"uagb_featured_image_src":[],"uagb_author_info":{"display_name":"QA Analytics Support","author_link":"https:\/\/mem.quarka.org\/en\/author\/qa-analytics-support\/"},"uagb_comment_info":0,"uagb_excerpt":"QA Analytics utilizes jQuery, which is registered with WordPress, for measurement.Therefore, you need to load the QA JS file after loading jQuery. If you have a &#8220;defer&#8221; in the script tag to load &#8216;jquery,&#8217; this order will be affected.As a result, the measurement may not work properly, causing &#8220;no data&#8221; or &#8220;the heatmap does not&hellip;","_links":{"self":[{"href":"https:\/\/mem.quarka.org\/en\/wp-json\/wp\/v2\/ht_kb\/2092"}],"collection":[{"href":"https:\/\/mem.quarka.org\/en\/wp-json\/wp\/v2\/ht_kb"}],"about":[{"href":"https:\/\/mem.quarka.org\/en\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/mem.quarka.org\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mem.quarka.org\/en\/wp-json\/wp\/v2\/comments?post=2092"}],"version-history":[{"count":7,"href":"https:\/\/mem.quarka.org\/en\/wp-json\/wp\/v2\/ht_kb\/2092\/revisions"}],"predecessor-version":[{"id":3665,"href":"https:\/\/mem.quarka.org\/en\/wp-json\/wp\/v2\/ht_kb\/2092\/revisions\/3665"}],"wp:attachment":[{"href":"https:\/\/mem.quarka.org\/en\/wp-json\/wp\/v2\/media?parent=2092"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/mem.quarka.org\/en\/wp-json\/wp\/v2\/ht_kb_category?post=2092"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/mem.quarka.org\/en\/wp-json\/wp\/v2\/ht_kb_tag?post=2092"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}