I wrote my own php captcha script, with a jpeg header, so that I can say
<img src="captcha.php">
which works by storing the value of the captcha into the session variable. When the user can't read it, I want it to be refreshable.
I first tried
$("#refresh").click(function() {
$("#captcha").attr("src","captcha.php");
});
but of course that doesn't make sense, and I need to make an ajax call instead. How would you all recommend I do this?
P.S. I also tried
$.ajax({
url: "captcha.php",
success: function(result) {
$("#captcha").attr("src",result);
}
});