Home >Web Front-end >JS Tutorial >When loading remote images, the solution is often not updated due to caching (share)_javascript skills

When loading remote images, the solution is often not updated due to caching (share)_javascript skills

WBOY
WBOYOriginal
2016-05-16 17:31:141171browse

The principle is very simple, just let you get a different url for the remote image each time

Copy the code The code is as follows:

$(".myImg").src("yourUrl.action?randUrl" Math.ceil(new Date()/3600000);

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn