A modern browser is required for security, reliability, and performance. Contact us.

Jun 28 2012

Async Disqus Loading in Tumblr

We noticed that Disqus was causing our Tumblr blog to load slowly. This was the fix:

$(function(){
  var links = $('a');
  var query = '?';
  for(var i = 0; i = 0) {
        query += 'url' + i + '=' + encodeURIComponent(links[i].href) + '&';
    }
  }
  $('head').append('<script charset="utf-8" type="text/javascript" src="http://disqus.com/forums/{text:Disqus Shortname}/get_num_replies.js' + query + '">' + '</script>');
});

—Sam Saccone

MojoTech

Share: