Loading AddThis / Facebook like button / TwitterCounter

Hello,

I am working on a site that loads 3 external resources.

-AddThis button

<!-- AddThis Button BEGIN -->
<div class="addthis">
<div class="addthis_toolbox addthis_default_style">
<a href="http://www.addthis.com/bookmark.php?v=250&amp;username=espett" class="addthis_button_compact">Share</a>
<span class="addthis_separator">|</span>
<a class="addthis_button_facebook" style="cursor:pointer"></a>
<a class="addthis_button_twitter" style="cursor:pointer"></a>
<a class="addthis_button_email" style="cursor:pointer"></a>
<a class="addthis_button_favorites" style="cursor:pointer"></a>
</div>
<script type="text/javascript">var addthis_config = {"data_track_clickback":true};</script>
<script type="text/javascript"  src="http://s7.addthis.com/js/250/addthis_widget.js#username=espett"></script>
<!-- AddThis Button END -->

-Facebook follow button (not javascript)

<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2F%23%21%2Fpages%2FFishListcom%2F130266186986815%3Fref%3Dsgm&amp;layout=button_count&amp;show_faces=false&amp;width=75&amp;action=recommend&amp;font=arial&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:126px; height:21px;" allowTransparency="true"></iframe>

-TwitterCounter button

<!-- Start of TwitterCounter Code -->
<script type="text/javascript" language="javascript" src="http://twittercounter.com/widget/index.php?username=FishList"></script>
<!-- End of TwitterCounter Code -->

These scripts always hold up the rest of the page from loading. Is there anyway to defer them from loading or load them asynchronously?

Thanks!

Hiya :slight_smile:

(forgive the brevity, at work atm.)

  • Addthis can be loaded Asynchronously http://www.addthis.com/help/optimizing-addthis

  • You could use the FB opengraph like button that gets inserted with JS, which will help speed up loading a bit.

  • You might be able to load the twitter counter after the DOM has loaded. Perhaps something like LAB JS will be useful.