Fil wrote:
> @ SDisk SDisk <[EMAIL PROTECTED]> :
>> You can not load images with AJAX simply create a new image object and
>> append, then the image can load asyncronously. Try this simple jQuery
>> plugin:
>>
>> $.fn.image = function(src, f){
>>    return this.each(function(){
>>        var i = new Image();
>>        i.src = src;
>>        i.onload = f;
>>        this.appendChild(i);
>>    });
>> }
>>
>> Then call this plugin like:
>> $("#container").image("http://jquery.com/images/hat2.gif",function(){
>>  alert("The image is loaded now");
>> });
> 
> This works nicely with FF, but not with Safari. Or am I doomed?
> 
> -- Fil

Try swapping the order of the lines above to:

i.onload = f;
i.src = src;

So that the onload is set before you start loading the image... Not sure 
but that may help?

Cheers,

Kelvin :)

_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

Reply via email to