javascript - Force image reload keeping url -
I usually use the src change to refresh the image:
Var img = $ (this) .find ('img'); Var src = img.attr ('src'); $ AJAX ({success: function} {img.attr ('src', src + '? R =' + Math.random ()). Load (function () {img.attr ('src', src); });}});
To use the previous default path
img.attr ('src', src);
But I'm refunding my previous image, so the browser still has to keep this image in the cache. How can I force the browser to reload the url to keep this image?
To prevent you from loading a cachebuster, the browser to load its timestamp query parameter: < / P>
img.attr ('src', src + '? T =' + new date (.) GetTime ());
Comments
Post a Comment