Archive for June, 2006

Hover Detail

Sunday, June 11th, 2006

Tonight I added a hover detail to the Flickr thumbnails on the right. If you mouse over a thumbnail, you can see a large version of the photo. If you click on the large photo, its Flickr page loads in a new window.

I’m using the MTFlickrPhotos plugin to generate thumbnails, and to write the HTML for the large images into a hidden DIV. I’d like to load the large images asnchronously, but I need to work out how to request images. So far I’ve just used Ajax.Updater to preload HTML.

Oh yes, did I mention that the hover details are completely hosed in IE?

given a set of id3v1 tags, infer the values of blank ARTIST and TITLE fields with Perl

Thursday, June 8th, 2006

In 2001, I wrote a Perl script to put id3v1 tags into mp3 files that didn’t have any tag information; using MP3::Info to get and set tag information.

Explicitly Trigger A JavaScript Event Handler

Wednesday, June 7th, 2006

<script type="text/javascript">
function foo(){ alert("Hello World") }
<div id="bar" onclick="foo();">click me to see an alert</div>
<div onclick = "document.getElementById('bar').onclick()" > click me to do the same thing </div>

This is trivial, but the subject came up at work today; and I wound up making a little demo, which I’ll now post.

Explicitly Trigger An Event Handler in JavaScript

Set a nested DOM property with Javascript, using square bracket notation

Tuesday, June 6th, 2006

In the comp.lang.javascript Javascript Best Practices document, I came across an interesting discussion of the reasons for preferring square bracket notation to eval().

The consensus seems to be that eval is evil, and that “if it exists in your page, there is almost always a more correct way to accomplish what you are doing.”


Position an element above the fold dynamically with JavaScript

Monday, June 5th, 2006

I put together some JavaScript to keep an element above the fold.

This was written at the last minute for the Barney’s New York launch; to spruce up the admin tool for their new web site. I only had time to test it in IE6 and Firefox 1.x, but I believe it works in Safari as well. Additionally, I do know that this bit of code has been in use internally at Barney’s for a few months now without any complaints coming back. So it may work well on older browsers too; although I believe there are compatibility issues with document.body.clientHeight in some browsers.