2
I created a plugin to cut images through javascript and PHP but I’m having trouble revealing the edited image after the success of Crop in ajax
.
I’ve already researched the subject and found a trick that works for most major browsers except Chrome which consists of generating a random string and joining it at the end of the image link.
This is the code I’m using at the moment:
$.post('printmw/ajax_crop', $.param(croper), function(result){
data = JSON.parse(result);
if(data.result == 'success'){
$(active_img).parent().find('img').attr('src', 'images/'+croper['image']+'#'+ new Date().getTime());
}
});
How do I make Chrome free the cached image and reload with the new?
It usually works for me when I put the strings in front (even in Google Chrome). Try, instead of using
#
, wear a?
. Something that comes back likeminha_image.png?78782012124
– Wallace Maxters