[jQuery] Refresh an image with dynamic src URL?

[jQuery] Refresh an image with dynamic src URL?

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2963" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=093181106-14112006><FONT face="Trebuchet MS"
size=2>I like this method too, since it puts the work on PHP instead of
Javascript, but unfortunately, in this case, I do not control the image
generating script.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=093181106-14112006><FONT face="Trebuchet MS"
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=093181106-14112006><FONT face="Trebuchet MS"
size=2>m.</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> discuss-bounces@jquery.com
[mailto:discuss-bounces@jquery.com] <B>On Behalf Of </B>Aaron
Heimlich<BR><B>Sent:</B> Monday, November 13, 2006 8:34 PM<BR><B>To:</B> jQuery
Discussion.<BR><B>Subject:</B> Re: [jQuery] Refresh an image with dynamic src
URL?<BR></FONT><BR></DIV>
<DIV></DIV>On 11/13/06, <B class=gmail_sendername>Blair Mitchelmore</B> <<A
href="mailto:jquery@offput.ca">jquery@offput.ca</A>> wrote:
<DIV><SPAN class=gmail_quote></SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">If
you want to defeat the cache you could try appending the current time<BR>as a
query string:<BR><BR>img.src = fileName + "?" + (new
Date()).getTime();<BR><BR>-blair<BR></BLOCKQUOTE></DIV><BR>Another solution
would be to, in your image generating script, send HTTP headers that tell the
browser not to cache the file. <BR><BR>Here's the PHP code that would
it:<BR><BR>header('Pragma: public');<BR>header('Expires: Thu, 19 Nov 1981
08:52:00 GMT');<BR>header('Cache-Control: must-revalidate, post-check=0,
pre-check=0');<BR>header('Cache-Control: no-store, no-cache,
must-revalidate');<BR><BR></BODY></HTML>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/