Performance Issues with AddThis plugin how to implement this solution?
-
The load performance of my blog is showing up AddThis as being the main culprit (I have made other changes to improve load time, but AddThis is now top of the slow list).
From reading other posts here and on the AddThis forum it seems that adding there are two options or two stages contained in this post:
https://www.addthis.com/forum/viewtopic.php?f=2&t=35161
I am a little unclear as to the steps, maybe someone can enlighten me. After reading and rereading I assume these are the steps but I would just like to check as i am not a professional programmer.
Step 1 Add &async=1 to the URLs in the plugin (there are three URLs to add it to in the plugin’s addthis_social_widget.php);
Step 2 At the bottom before the </body> tag, insert this JS code.
<script type="text/javascript"> function initAddThis() { addthis.init() } // After the DOM has loaded... initAddThis(); </script>
Step 3 This can be implemented by running this in the body tag’s onload attribute or using jQuery like so:
$(window).load(function(){ addthis.init(); });
Steps 1 and 2 seem clear to me, but where do I add Step 3 exactly. Or have I got the wrong end of the stick and mixing apples and pears.
Any assistance is much appreciated as I have been banging my head with this issue all day.
- The topic ‘Performance Issues with AddThis plugin how to implement this solution?’ is closed to new replies.