我得到了这个<head>
:
<head>
<link rel='stylesheet' href='/animated/animate.css' type='text/css' media='all' />
<script type='text/javascript' src='/animated/animated.js'></script>
</head>
我需要在 IE8 及更低版本中禁用这两个文件。
有什么办法可以做到这一点吗?
最佳答案
使用条件注释。在这种情况下你可以使用 -
<head>
<!--[if gt IE 8]> <!-->
<link rel='stylesheet' href='/animated/animate.css' type='text/css' media='all' />
<script type='text/javascript' src='/animated/animated.js'></script>
<!-- <![endif]-->
</head>
请注意: gt
表示“大于”,而 gte
表示“大于或”等于'。
从 here 了解有关条件注释的更多信息
关于javascript - 删除 ie8 及更早版本中的 JS 和 CSS 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25252423/