Asynchronous loading of tweet button


#1

I’m using JavaScript method, mentioned at https://dev.twitter.com/docs/tweet-button to add Tweet button to our website and its working fine. But in few blogs people are saying that the Tweet Button by Twitter is loading in a blocking way so it is slowing down the page. At the same time few people are saying Twitter has updated their code to an asynchronous mechanism. Please make it clear as nothing is mentioned at https://dev.twitter.com/docs/tweet-button. One of the page in our site where Tweet button is there http://www.consumerguide.com/audi/r8/


#2

well, try this code :

I tryied it on http://www.nmisr.com and no error of async loading on google pagespeed test


#3

All the codes we offer from our creation tools use an asyncronous loading mechanism (an inline script that injects the script without blocking.) It’s been this way for a couple of years now.

(The version for embedded Tweets just uses the browser-native async attribute, since the inline code version tends to be more likley to get butchered by CMS editors, but we do our best, and of course, publishers can arrange the script include any way they like in their page template.)

Ben


#4

The code provided at https://dev.twitter.com/docs/tweet-button inserts a script element that loads the button’s code. Even though that element is supposed to load asynchronously by default, I have found to request so explicitly helps:


#5

#6