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

Popular posts from this blog

c++ - C/pp Sockets, recv()/send() works only under gdb -

GO: Serve static pages -

objective c - How to open front/back camera at the same time in iOS developing? -