gpt4 book ai didi

html - <!--[if gte IE 8]--> 没有像我预期的那样表现

转载 作者:搜寻专家 更新时间:2023-10-31 22:09:43 26 4
gpt4 key购买 nike

使用以下代码来防止 IE8 之前的任何版本的 IE 加载几个脚本。

问题是脚本仍然在 IE7 中加载,条件标签(在文档的标题内)实际上正在渲染并显示在页面上!!

<!--[if gte IE 8]-->
<script src="<?php bloginfo('template_url'); ?>/scripts/voter.js" type="text/javascript"></script>
<script src="<?php bloginfo('template_url'); ?>/scripts/hover.js" type="text/javascript"></script>
<!--[endif]-->

最佳答案

问题是您要立即关闭条件注释(即末尾有 -->),这是无效语法。

而不是 <!--[if gte IE 8]--> , 你应该有 <!--[if gte IE 8]>其次是 <![endif]-->关闭。

Microsoft's page about Conditional Comments有很多关于如何使用它们的示例。

关于html - &lt;!--[if gte IE 8]--> 没有像我预期的那样表现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3987925/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com