David Madore's WebLog: Another gimmick

Index of all entries / Index de toutes les entréesXML (RSS 1.0) • Recent comments / Commentaires récents

Entry #0163 [older|newer] / Entrée #0163 [précédente|suivante]:

(Friday)

Another gimmick

Well, I thought this one would prove impossible, but I devised a hack to do it anyway—on Mozilla only, however: now, if you browse this 'blog using Mozilla (possibly only a recent version), each entry's Comments link should have next to it, in parentheses, the number of comments posted on that entry, and the timestamp of the most recent one. If you don't see anything, it can mean several things: the system might not be functioning, or there are no comments, or your browser is not Mozilla. I can't think of a way that would print something different in each of these cases—or I can, but it's too ugly.

This is not a gratuitous way of saying please use Mozilla, by the way: I really don't know how the same result could be achieved without using the Extensible Binding Language, one of these really cool Mozilla inventions. For those who wish to know a little how the trick is achieved (remember that I can't specially modify the 'blog's HTML itself, because it sits on a different server), it's simple, really: after every Comments link comes an empty <span> element, which specifies by a style property that it is to be controlled by an XBL binding which sits on the same server where the comments are stored (my home PC, that is), and the XBL bindings just add the (“anonymous” in Mozilla terminology) content that you see next to the link. If anything goes wrong, the bindings are not served, and you don't see anything, but there's no harm done (and the 'blog page can be viewed without problem). I'm not sure how this will interact with the cache, however: it seems that the XBL file is reloaded independently from its calling HTML file, but I'm not entirely certain of it either (these HTTP cache questions are really thorny). We'll see.

Please let me know of any strange behavior you might observe.

(For those who cannot, will not, or for any other reason do not use Mozilla, the best I can suggest is that you click on the Comments link of any entry and then follow the Recent comments link.)

↑Entry #0163 [older|newer] / ↑Entrée #0163 [précédente|suivante]

Recent entries / Entrées récentesIndex of all entries / Index de toutes les entrées