views:

30

answers:

1

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

The problem is the script is still loaded in IE7, and the conditional tags (which are within the header of the document) are actually being rendered out 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]-->
+4  A: 

The problem is that you're closing the conditional comment immediately (ie with the --> at the end), which is invalid syntax.

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

Microsoft's page about Conditional Comments has a lot of examples of how to use them.

Spudley