<! - [if gte IE 8] & # 8594; not behaving as i expect

using the following code to prevent any version of IE prior to IE8 from loading multiple scripts.

The problem is that the script is still loading in IE7, and the conditional tags (which are inside the document title) are actually displayed and displayed on the page!

<!--[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]-->
+3
source share
1 answer

The problem is that you immediately close the conditional comment (that is, with -->the end), which is an invalid syntax.

Instead, <!--[if gte IE 8]-->you should have <!--[if gte IE 8]>followed by <![endif]-->to close.

Microsoft , .

+10

Source: https://habr.com/ru/post/1770730/


All Articles