Reputation: 2317
I have seen code like this:
<script type="text/javascript" src="js/my_js.js?id=<?php echo time(); ?>"></script>
I do not understand the reason for the id, nor how to use the id in the .js file, if this is possible.
Thanks.
Upvotes: 0
Views: 88
Reputation: 478
It is to force the browser to refresh the JavaScript file, otherwise the browser may display a cached version at a later date.
You can also do this to CSS files.
Upvotes: 4