我一直在查看HTML 5样板模板(来自http://html5boilerplate.com/),并注意到"?v=1"
在引用CSS和Javascript文件时在URL中的使用。
"?v=1"
在链接和脚本标记中附加到CSS和Javascript URL有什么作用?- 并非所有的Javascript URL都有
"?v=1"
(示例来自以下示例:)js/modernizr-1.5.min.js
。有这种原因吗?
来自他们的样本index.html
:
<!-- CSS : implied media="all" -->
<link rel="stylesheet" href="css/style.css?v=1">
<!-- For the less-enabled mobile browsers like Opera Mini -->
<link rel="stylesheet" media="handheld" href="css/handheld.css?v=1">
<!-- All JavaScript at the bottom, except for Modernizr which enables HTML5 elements & feature detects -->
<script src="js/modernizr-1.5.min.js"></script>
<!------ Some lines removed ------>
<script src="js/plugins.js?v=1"></script>
<script src="js/script.js?v=1"></script>
<!--[if lt IE 7 ]>
<script src="js/dd_belatedpng.js?v=1"></script>
<![endif]-->
<!-- yui profiler and profileviewer - remove for production -->
<script src="js/profiling/yahoo-profiling.min.js?v=1"></script>
<script src="js/profiling/config.js?v=1"></script>
<!-- end profiling code -->