资 源 简 介
Introduction
image-refresh is a simple jquery plugin designed to refresh cached images via the addition of a short querystring to the image url.
Reason for this control?
I work with graphics manipulation and a lot of the time the problem comes where an image file changes on the fly and I need to refresh the image on my web page. Often enough, images are cached and so the way to get round that is to append a querystring (timestamp) to the image"s url.
How to use
Resources needed:
- Jquery (any version)
- jquery.imgrefresh.js or jquery.imgrefresh.min.js
Using the control is very simple. Attach the control to any image on your document like so:
Note: This control assumes the img element contains a valid image link.
$("img#yourimage").imgrefresh();
When this code is run, it will automatically append a querystring (?refresh=123) to the image"s url. This will force the image to refresh.
Robustnes