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.