EngLee's Path

A blog about Eng Lee's life, a freelance programmer in Royal Klang Town (Malaysia).


Wednesday, July 22, 2009

Twitter Widget Scripts for Blogger (Good Tip!)


If you added Twitter widget to your blogger, especially you, remember to move the following section of the code to the bottom of your template so that your blog doesn't have to wait for twitter to load first.
<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/englee.json?callback=twitterCallback2&amp;count=7"></script>

I notice that this blog loaded halfway up to the twitter section, then it stops for a few seconds, then it continues to load. It is caused by twitter widget loading slower than the blog itself. Sometimes, it might fail too. So, it's better to move the actual JavaScript that does the loading to the bottom of your blog, right before the </body> tag.

Got this tip from Twitter while procrastinating.

If you are too lazy to do your own code editing, just go to Twitter's Widget Page to get the code!

Labels:

4 Comments:

Post a Comment

<< Home