问题
I have the following code:
$('#imageform').submit(function() {
$("#imageBox").html('');
$("#imageBox").html('<img src="img/loader.gif" alt="Uploading...."/>');
$("#imageform").ajaxSubmit(
{
target: '#imageBox',
resetForm: true
});
return false;
});
In IE, the image will be cached and not reload, I wanted to force it to refresh. The problem is that I rename the image in a PHP file, so I wanted to know how to add a paramter (?date) AFTER the image is loaded.
回答1:
Try this:
var counter = 0;
...
$("#imageBox").html('<img src="img/loader.gif?c='+counter+'" alt="Uploading...."/>');
counter++';
来源:https://stackoverflow.com/questions/9207090/ie-image-caching-with-jquery-form-force-image-reloading