Some of you probably saw our Outside the Box blog post from earlier today — what you might not have noticed is that the sample comments in the post aren’t screenshots, nor are they simply fancied up blockquotes.
They’re a new feature we’re releasing today: embedded comments.
Just like tweets, you can now embed ALA comments anywhere you like. This is one of those features that we’ve been wanting for our own purposes, and then we figured: as long as we’re building it, let’s give everyone the ability to embed comments.
The embed code consists of markup representing the comment (as a fallback for if the script fails to load — for example, in an RSS feed) and an asynchronous
script tag that fetches a live comment from our server using AJAX, the contents of which are injected into an iframe. By using AJAX to talk to a cross-origin enabled endpoint rather than simply setting the iframe’s
src attribute, we avoid cross-domain security issues that might prevent us from manipulating the contents of the iframe.
The iframe then replaces the fallback markup, and voila — a real live embedded comment.
We look forward to seeing what you do with it.