<scripts> 如何在评论标签内加载?
How do <scripts> load inside of comment tags?
以下代码位于页面的头部:
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
评论标签不应该阻止这个脚本运行吗?
IE 使用这些样式注释(IE 条件注释)聪明,并且知道将它们视为正常 HTML。
它叫做条件注释
https://msdn.microsoft.com/en-us/library/ms537512(v=vs.85).aspx
http://www.quirksmode.org/css/condcom.html
仅适用于 Internet Explorer。
以下代码位于页面的头部:
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
评论标签不应该阻止这个脚本运行吗?
IE 使用这些样式注释(IE 条件注释)聪明,并且知道将它们视为正常 HTML。
它叫做条件注释
https://msdn.microsoft.com/en-us/library/ms537512(v=vs.85).aspx http://www.quirksmode.org/css/condcom.html
仅适用于 Internet Explorer。