How to append timestamp to the javascript file in [removed] tag url to avoid caching

前端 未结 8 1795
[愿得一人]
[愿得一人] 2020-11-28 08:21

I want to append a random number or a timestamp at the end of the javascript file source path in so that every time the page reloads it should download a fresh copy.

<
8条回答
  •  再見小時候
    2020-11-28 09:27

    Load scripts manually or with jQuery http://api.jquery.com/jQuery.getScript/. It also provides option to prevent chaching

提交回复
热议问题