I've created a plugin to crop images through javascript and PHP, but I'm having trouble revealing the edited image after the success of the crop in ajax
.
I already researched the subject and found a trick that works for most of the main browsers except Chrome that consists of generating a random string and joining it at the end of the image link.
This is the code I am currently using:
$.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 free the cached image and reload with the new one?