Reputation: 731
Hy ,
I have this ajax code that works fine in Chrome but in Firefox does not. I have a php script that generates a captcha code image , i verify it through javascript and ajax. If the user inserts the correct code in firefox the scripts returns 1 , if the user insert the wrong code the script returns 0 and changes the picture , if the user inserts again the wrong code the script returns 0 but it does not change the picture (In firefox , in chrome works fine everytime)
$("#finish").click(function() {
//$(function() {
var text = $("#captchaText").val();
//alert(text);
//var session = $("#captchaText2").val();
//alert(session);
$.ajax({
//type: 'POST',
url: 'includes/scripts/validation.php',
data: 'id='+text,
success: function(response){
alert(response);
if(response == 0){
$('#poza').html('<p><img src="includes/scripts/CaptchaSecurityImages.php" /></p>') ;
}
}
});
});
Upvotes: 0
Views: 493
Reputation: 731
It appears that firefox stores it in cache. By adding a rand solved it.
Upvotes: 2