From: wilq on 22 Oct 2009 04:34 > 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.
First
|
Prev
|
Pages: 1 2 Prev: cluttered code prevention? Next: Are arguments that are objects passed by reference? |