简体   繁体   中英

how to change cached picture from javascript

I have a asp image control. ImageUrl="images/avator.jpg". I'm changing this picture on the server and then setting imageUrl same as previous url on the client. but image don't changed. When i click refresh button, image changed. How to change cached image won't changing url?

You can add random number as a paramentr to avoid caching.

<img src="http://someurl.com/avatar.png?version=0.01.135";

The best way is to add number of application build version. So every time you change something in aplpication everything will load again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM