AJAX Inline Comments

January 13, 2006
5:27 am
Posted in: Announcements

Update: a lot of people are misunderstanding what this is and are flooding this entry with “test” comments. If you want to see this in action, go to my front page. Find an entry with comments and click “show comments here.” There’s nothing fancy about my comment submission system.

I’ve been wanting to do this for a while, and I finally got around to doing it. My inline comments (“show comments here”) are now fetched asynchronously. Or, for those of you who speak Web 2.0-ese: AJAX is teh l33t 4 tha inline commentz!

And for those of you who don’t know what the heck I’m talking about… my inline comments used to be downloaded when you viewed my front page. They were just hidden. Clicking the link would reveal them. The problem with this is that as my posting rate has slowed and my comment rate has risen, there can be quite a few “hidden” comments being downloaded, which slows things down, both in terms of bandwidth and server queries. Now, the comments aren’t loaded. When you click the link, they are asynchronously downloaded in the background (it’s so fast, you probably didn’t even notice). Pretty slick, eh?

I used Moo.ajax to do it. I experimented with some of the Moo.fx effects for bringing them in, but there were complications, and it didn’t look so great for posts with many comments. But I do like Moo.fx a lot, and am likely going to find a use for it somewhere on this site.

Update: I have gotten the Moo.fx effects working reliably! So check out the inline comments now… there is a “throbber” animation as they load (which should only show for a split second with broadband… longer on dialup), and then when they load, they fade in and expand down. The fade/expand effect is used again for subsequent expands/contracts (without downloading the comments again, obviously).

Mark Jaquith

Hi. I’m Mark Jaquith (JAKE-with). I make the WordPress publishing platform and am a freelance WordPress consultant. This is my personal blog. You can subscribe to my feed or follow me on Twitter and Google+.

40 Responses

Comments temporarily hidden. Will unhide once I get the spam under control.