Ah, now that's a very elegant solution. Bonus points since it works  ;)

Thank you.

m. 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Blair Mitchelmore
Sent: Monday, November 13, 2006 8:29 PM
To: jQuery Discussion.
Subject: Re: [jQuery] Refresh an image with dynamic src URL?

If you want to defeat the cache you could try appending the current time
as a query string:

img.src = fileName + "?" + (new Date()).getTime();

-blair

Matt Grimm wrote:
> What would be an ideal way to refresh an image whose src attribute is 
> a script that dynamically generates the image? Would it be best to 
> store the value of the src attribute in a variable, remove the img 
> element from the DOM, and append a new image element with the same 
> URL? In my quick tests, it seemed like the browser was just using the 
> same image from the cache and I'm not sure how to get around that.
> 
> Thanks for anything!
> 
> m.
> 
> _______________________________________________
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/

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

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

Reply via email to