Halfbrown 100% Hapa Powered

15Jan/101

A Valid Twitter HTML Widget.

A Valid Twitter HTML Widget.

I was a bit surprised when I found out the (now older and difficult, if not impossible, to find anywhere on Twitter) Twitter HTML widget didn't validate. They've got an empty <ul> (e.g. without any <li>'s) in their code, and that makes the W3 HTML validator cranky.

The fix (in bold below) is simple enough:

<ul id="twitter_update_list"><li style="display: none;"></li></ul>
<script type="text/javascript" src="http://twitter.com/javascripts/blogger.js"></script>
<script type="text/javascript" src="http://twitter.com/statuses/user_timeline/YOUR_USER_NAME.json?callback=twitterCallback2&count=5"></script>

That's it! Easy peasy, Mac-n-Cheesey. Just make sure to also replace "YOUR_USER_NAME" with your actual Twitter username. And keep in mind that this is clay... I didn't do anything fancy to any of the resulting HTML, there's no CSS to style the return all prettified and whatnot. I leave that up to you.

If you want to talk about this Twitter HTML widget fix, please feel free to leave a comment here on the blog. You can also follow me on Twitter to talk about it, or just say "Hi".

Image by halfbrown.

Comments (1) Trackbacks (0)
  1. @jxhn Typo fixed! Thanks. :)

Leave a comment


No trackbacks yet.