IE9 and jquery AJAX problem….
“first time it works well if I click on button, but second time it doesn’t…I assume cache”
I have jquery https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js
And simple ajax call:
$('#isvalidcompany').click(function(event) {
var image = $('#isvalidcompany_img');
var old_state = image.attr('src');
image.attr('src', '/images/loading.gif');
$.getJSON('/ajax/change',
function(data) {
if (data['error'] != '') {
image.attr('src', old_state);
$('#isvalidcompany_error').html(data['error']);
} else {
if (data['isvalidcompany'] == 1) {
image.attr('src', '/icons/tick_16.png');
} else {
image.attr('src', '/icons/delete_16.png');
}
}
});
return false;
});
And on all browser it is working well, except ie9 and ie8 and ie7
So if anyboday have experience on this please share 🙂
I experienced such error one time, I was a caching problem, so solve it, each time I send a new ajax request, I appended the url with a new random number.
Hope this helps you.