Addtoany slow loading

24th of June 2010 0

Addtoany slow loading

When working with a clients site i wanted to the sharing script from AddToAny, i however noticed that the inclusion of their javascript bogged the whole site down and caused extreme delays (3+ seconds).

addtoany slow loading

This wasn't acceptable at all so i had to come up with a proper solution which was quite simple with some jQuery and ajax:

<script type="text/javascript">
$(window).load(function() { $.ajax({ url: 'http://static.addtoany.com/menu/page.js', dataType: 'script' }); });
</script>

We simply dump the code we get from AddToAny and replace the call to their servers with the jQuery ajax scripts that loads "onload". This efficiently kills all slow load delays and the only drawback is that your AddToAny-button(s) only will work when a page has finished loading.

Filed under § Jquery

Share it!

Was it good for you to?

Sponsors

Support for the site!


Your opinion matters. Add it below.


Tip: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • Popular posts this month
  • 5 Random posts
  • Simple CSS buttons When working with a clients site i wanted to the sharing script from AddToAny, i however noticed that the inclusion ...
  • jQuery show / hide anything When working with a clients site i wanted to the sharing script from AddToAny, i however noticed that the inclusion ...
  • Top posts this month When working with a clients site i wanted to the sharing script from AddToAny, i however noticed that the inclusion ...
  • Crossbrowser text shadow with jQuery When working with a clients site i wanted to the sharing script from AddToAny, i however noticed that the inclusion ...
  • jQuery simple tabs When working with a clients site i wanted to the sharing script from AddToAny, i however noticed that the inclusion ...

Follow me @design_byme RSS Design Feed

Copyright Tommie Hansen since 2010. All rights reserved. Design and the Absolute Theme by Tommie Hansen.