Questions tagged [conditional-comments]

Conditional Comments are a feature of Microsoft's Internet Explorer web browser. They allow a web page to check the browser version.

Conditional Comments are a feature of Microsoft's Internet Explorer web browser. They allow a web page to check the browser version.

See the various articles in the matter:

248 questions
5
votes
4 answers

Conditional Comments Firefox

Are there specific Conditional Comments available for older versions of Firefox? (eg 3.0)
Nutmeg
  • 155
  • 1
  • 1
  • 5
5
votes
1 answer

IE conditional comments with Sass and Bourbon

I want to serve different fonts to different browsers (see this question). Is there a slick way to do this with Sass/Bourbon? Here's what I have so far: @include font-face("myicons", "myicons", $weight: normal, $style: normal, …
John Bachir
  • 22,495
  • 29
  • 154
  • 227
5
votes
2 answers

HTML IE conditional statement: Not working with Chrome/Firefox

I have the following in my html document. i am IE i am not ie When viewed in IE it properly says "i am IE" When viewed in Chrome/Firefox it incorrectly says "i am IE i am…
user984003
  • 28,050
  • 64
  • 189
  • 285
5
votes
3 answers

IE10 is reading IE8 conditional comments

I have a website page that displays a warning box if you are using an unsupported browser, IE<=8. This works fine in IE 8 and below, however today I was testing in IE 10 and it seems to also read this conditional. It shows the warning box when it…
5
votes
4 answers

/*@cc_on and IE6 detection

When researching JavaScript conditional comments for IE, I stumbled upon @cc_on. This seems to work. However, the wikipedia entry on conditional comments provides the following code for more robust IE detections, specifically IE6: /*@cc_on …
5
votes
2 answers
5
votes
1 answer

JSF 2.1 & IE Conditional Comments

I've noticed that in JSF 2.1.* my IE conditional comments are no longer working. Various characters are being replaced by HTML entities & invalidating the comment syntax. BalusC has pointed out a solution to the problem in another question which…
Lee Theobald
  • 8,461
  • 12
  • 49
  • 58
4
votes
6 answers

Conditional Comments and Valid XHTML

Given the code (which looks like it should be valid): The W3C validator throws a fit: S separator in comment…
Justin
  • 5,029
  • 1
  • 21
  • 21
4
votes
1 answer

IE conditional comments working but tags visible?

I have the magnificent HTML5 javascript shim linked to in my . It works fine apart from it displays the tags at the top of the page ie: When I view source, it looks absolutely fine and dandy. I have absolutely no…
Jake Rayson
  • 921
  • 7
  • 20
4
votes
5 answers

Don't load script in IE6 or less

How can I add a condition so that if a user is running IE6 or less not to load some javascript. I've tried the following, and the Can I…
Damian
  • 117
  • 1
  • 9
4
votes
1 answer

Don't load a script in IE8 and below?

This question must be a duplicate, but I can't find the definitive answer on here. How can I tell the browser not to load a script, if the browser is IE8 or below? I know about targeting IE9 and above: