From: wilq on

>   var img = document.images["preview"];
>   if (img)
>   {
>     var f =
>
>     _addEventListener(img, "error",
>       function() {
>         /* Don't error out if the replacement image doesn't load */
>         _removeEventListener(this, "error", arguments.callee);
>
>         this.src = "...";
>       });
>
>     img.src = 'Temp/' + ob.id + '.png';
>   }

As far as I know this way of attaching events leaks memory, but of
course jodleren maybe don't need good solutions. Just explain how the
"img" will be removed by garbage collector.