Problem when using ajax for refresh captcha with refresh button [closed]
- by jowan
But it doesn't work, I just get my image be vanished and I try METHOD 2,
I think it can work but I'm wrong coz i just get display with code of image not new captcha image
I am stack and confuse about what method exactly work to refresh my own captcha..
Any wrong in my code or my method can't be used to refresh captcha..
Could anyone tell me how to refresh captcha exactly ?
Thanks in Advance
JQUERY CODE
$('.refresh_captcha').click( function(){
$.ajax({
type: 'POST',
url: 'captcha_mk.php',
success: function(data){
//$('img').attr('src', data); // METHOD 1 ( I try it and my image is lost )
$('div').html('<img src=' + data); // METHOD 2 ( display code of image not captcha image)
}
});
});