bangkui Luo
bangkui Luo

Reputation: 41

How can I reload my js files when I restart my tomcat

When I update and reset my web project, client browser were unable get the newest js files.

So how to solve this problem.

I will appreciate that you can give me some advice

Upvotes: 4

Views: 961

Answers (2)

Ying Yi
Ying Yi

Reputation: 782

First, check your js file had updated in tomcat.
if the file is newest in tomcat.
The reason is the broswer cache.try to clear the brower cache.

If you use chrome,you can try this:
enter image description here

I usually use a chrome plugin to clear cache,The plugin named Clear Cache,you can find this plugin in chrome webstore. enter image description here

Upvotes: 1

zpc
zpc

Reputation: 107

or load js file like below

<script>
document.write("<script type='text/javascript' src='/js/test.js?"+Math.random();+"'></script>");
</script>

Upvotes: 0

Related Questions