<script src="/assets/abc.js?v='+new Date.getTime();" type="text/javascript"></script>
<link href="/assets/cder.css?v='+new Date.getTime();" rel="stylesheet"></link>
or,
var myVariable = Math.floor(Math.random() * 999999999999);
<script src="/assets/abc.js?v='+myVariable ;" type="text/javascript"></script>
<link href="/assets/cder.css?v='+new Date.getTime();" rel="stylesheet"></link>
I have tried this as below but the script is not loading on network tab.
<script type="text/javascript>
var script = document.createElement('script');
script.setAttribute('src', '/assets/abc.js?v=' + new Date.getTime());
var head1 = document.getElementsByTagName("head")[0];
head1.appendChild(script);
</script>
I am trying to add dynamic version(variable ) in script tag and stylesheet based on current time or some dynamic variable?
If possible, Please help me with the shortest and efficient solution.
How to achieve that?