mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-12 20:24:43 +08:00
13 lines
333 B
JavaScript
13 lines
333 B
JavaScript
/*
|
|
* By adding unique attribute to image's src, we
|
|
* force browser to reload/update cached image
|
|
* (useful for AJAX calls).
|
|
*/
|
|
function reloadImages(imgs) {
|
|
_.each(imgs, function (img) {
|
|
var src = $(img).attr("src");
|
|
src = src.split("?", 1);
|
|
src += "?timestamp=" + new Date().getTime();
|
|
$(img).attr("src", src);
|
|
});
|
|
}
|