I made it work both in Safari and FF by changing the insertion sequence: $.fn.image = function(src, f){ return this.each(function(){ $("<img />").appendTo(this).each(function(){ this.src = src; this.onload = f; }); }); }
$(document).ready(function() { $("#container").image("http://jquery.com/images/hat2.gif",function(){ alert("The image is loaded now"); }); }); Give it a try here: http://www.jquery.info/IMG/html/8_charger_une_image.html -- Fil _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/