Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4127138
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T00:07:30+00:00 2026-05-21T00:07:30+00:00

Hey all, doing some repairs on systems after the IE9 release earlier this month.

  • 0

Hey all, doing some repairs on systems after the IE9 release earlier this month. Just wanted to know if anyone else has experienced the same problems with conditional comments and IE9 as I have and if there are any better workarounds for my problem.

Conditional comments are pretty well known to work consistently as a workaround for the IE browsers. IE9 seems to break this. I was testing an IE9-specific script (specifically document.createElement(“<input name=’something’>”); broke in IE9 but thats a different issue), and I needed to make a workaround for IE 6 & 7. So I did this:

    <!--[if IE 6]>
    <script type="text/javascript">
        var ie6 = true;
    </script>
    <![endif]-->
    <!--[if IE 7]>
    <script type="text/javascript">
        var ie7 = true;
    </script>
    <![endif]-->

Turns out in IE9, both ie6 and ie7 are true. WTF.

My workaround was to change it to the conditional comment below reverse the logic and just do if(!ie9plus).

    <!--[if gte IE 9]>
    <script type="text/javascript">
        var ie9plus = true;
    </script>
    <![endif]-->

Is there a better workaround? Should we be yelling and screaming at the IE development team for breaking such an important aspect of web debugging?

EDIT: Upon further testing, it seems it was an encoding problem. Somehow the file was encoded wrong and it broke the conditional comment. When I changed the comment to the IE9 one I fixed the file encoding too. IE9 does in fact properly support conditional comments. Sorry about the FUD.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T00:07:31+00:00Added an answer on May 21, 2026 at 12:07 am

    The IE blog says they still work. They are, however, tied to the rendering mode and is either 7 or 9 (the former in compat view).

    The IE team discourages the use of conditional comments, though, as they cater for browsers, instead of detecting features. However, that’s probably mostly a consideration for Javascript.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey all, just wondering what the best way to add this capability was. I
Hey guys. Just like in the title - I'm having some problems doing it.
Hey all. I'm doing a linked list exercise that involves dynamic memory allocation, pointers,
Hey all, I have been doing nothing but web development over the last few
Hey all i am in need of some help getting my code working correctly
Hey all I'm extremely new to jquery and ajax and I'm looking for some
Hey there, I'm doing some queries to a MySQL database that involves some user-input..
NOTICE: THIS IS SOLVED, I WILL PUBLISH THE SOLUTION HERE ASAP. Hey all, Ok...
Hey all this is the first time i am calling a stored procedure via
Hey all you ruby on railers... I'm just a newbie as of right now..

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.