you can, replace your querystring... $("#captcha").attr("src").replaceWith("inc/captcha/captcha.php?test=123");
in the next reload $("#captcha").attr("src").replaceWith("inc/captcha/captcha.php?test=231"); it isn't the best practice... 2009/5/6 Eric Garside <gars...@gmail.com> > > For reference, this php should properly force no-cache: > > Just be sure to replace $mime with the correct type for the image > (jpg, gif, whatever you're sending) > > header('Content-Type: ' . $mime); > header('Cache-Control: no-cache'); > header('Pragma: no-cache'); > > On May 6, 2:30 pm, Ricardo <ricardob...@gmail.com> wrote: > > On May 6, 6:46 am, heohni <heidi.anselstet...@consultingteam.de> > > wrote: > > > > > > > > > Hi, after sending a form, I would like to reload the form in order to > > > send a new message. > > > Therefore I was resetting the old form, but I need to call a new > > > captch image. > > > It's currently like this: > > > > > <img src="inc/captcha/captcha.php" id"="captcha" alt="" border="0" > > > style="float:left;" /> > > > > > I thought I coud re-load it with: > > > $("#captcha").attr("src").replaceWith("inc/captcha/captcha.php"); > > > > > But this way I don't get a new call... to generate a new image and > > > with it connected a new session entry for the captcha code. > > > > > What can I do to create a real call to the file? Any ideas? > > > > .replaceWith() replaces one element with another. Use this: > > > > $("#captcha").attr("src", "inc/captcha/captcha.php"); > > > > This will reload the image assuming captcha.php is correctly sending a > > no-cache header. >