PC Review


Reply
Thread Tools Rate Thread

Conditional comments not identifying IE6

 
 
Michael Winter
Guest
Posts: n/a
 
      11th Dec 2005
A rather odd situation has come to my attention, and I'm curious to know
if I'm affected by it alone or if others do, too.

With IE5, Microsoft hijacked markup comments to allow content to be
presented to only IE, and even specific IE versions. The syntax[1] being:

<!--[if <comparison> IE <version>]>
...
<![endif]-->

where <comparison> and <version> are optional.

A simple example[2] of this feature would be:

<!--[if lt IE 6]>
<p>You are running IE 5.x.</p>
<![endif]-->
<!--[if gte IE 6]>
<p>You are running IE 6 or later.</p>
<![endif]-->

However, with IE 6 on this machine, I see the first, not the second,
paragraph.

Remarks, anyone?

Mike


[1] I noticed that the documented explanation of this feature
doesn't do a particularly good job of demonstrating version
comparisons. Indeed, the only brief example as a note near
the end:

[if IE lte 5.0000]

presents the comparison operator (lte) in the wrong location.
Perhaps this can be rectified, and a complete example
included?

<http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp>

[2] <http://mwinter.webhop.info/conditional-comments.html>

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
 
Reply With Quote
 
 
 
 
Rob Parsons
Guest
Posts: n/a
 
      11th Dec 2005
Hi Michael,

Could this be the answer?
All downlevel browsers ignore the entire script block and treat the entire
comment, including any HTML content, as a single HTML Comment.


"Michael Winter" <(E-Mail Removed)> wrote in message
news:RTYmf.6739$(E-Mail Removed)...
> A rather odd situation has come to my attention, and I'm curious to know
> if I'm affected by it alone or if others do, too.
>
> With IE5, Microsoft hijacked markup comments to allow content to be
> presented to only IE, and even specific IE versions. The syntax[1] being:
>
> <!--[if <comparison> IE <version>]>
> ...
> <![endif]-->
>
> where <comparison> and <version> are optional.
>
> A simple example[2] of this feature would be:
>
> <!--[if lt IE 6]>
> <p>You are running IE 5.x.</p>
> <![endif]-->
> <!--[if gte IE 6]>
> <p>You are running IE 6 or later.</p>
> <![endif]-->
>
> However, with IE 6 on this machine, I see the first, not the second,
> paragraph.
>
> Remarks, anyone?
>
> Mike
>
>
> [1] I noticed that the documented explanation of this feature
> doesn't do a particularly good job of demonstrating version
> comparisons. Indeed, the only brief example as a note near
> the end:
>
> [if IE lte 5.0000]
>
> presents the comparison operator (lte) in the wrong location.
> Perhaps this can be rectified, and a complete example
> included?
>
>

<http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp>
>
> [2] <http://mwinter.webhop.info/conditional-comments.html>
>
> --
> Michael Winter
> Prefix subject with [News] before replying by e-mail.



 
Reply With Quote
 
Michael Winter
Guest
Posts: n/a
 
      11th Dec 2005
On 11/12/2005 22:26, Rob Parsons wrote:

> Could this be the answer?
> All downlevel browsers ignore the entire script block and treat the entire
> comment, including any HTML content, as a single HTML Comment.


No, because IE 6 - the one at issue - is not a 'downlevel' browser. IE 4
and earlier, as well as non-IE browsers are.

[snipped top-post]

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
 
Reply With Quote
 
Daniel Crichton
Guest
Posts: n/a
 
      12th Dec 2005
Michael wrote on Sun, 11 Dec 2005 16:57:21 GMT:

> A rather odd situation has come to my attention, and I'm curious to know
> if I'm affected by it alone or if others do, too.
>
> With IE5, Microsoft hijacked markup comments to allow content to be
> presented to only IE, and even specific IE versions. The syntax[1] being:
>
> <!--[if <comparison> IE <version>]>
> ...
> <![endif]-->
>
> where <comparison> and <version> are optional.
>
> A simple example[2] of this feature would be:
>
> <!--[if lt IE 6]>
> <p>You are running IE 5.x.</p>
> <![endif]-->
> <!--[if gte IE 6]>
> <p>You are running IE 6 or later.</p>
> <![endif]-->
>
> However, with IE 6 on this machine, I see the first, not the second,
> paragraph.
>
> Remarks, anyone?


Are you running any personal firewall software, pop-up stopper, or
anti-virus software that is masking/changing your User-Agent string? I've
just look at your page with IE6 (latest patches) on XP SP2 (latest patches)
and it shows the correct result. Get your page to display the actual
User-Agent header sent by the browser, and you should be able to spot why
it's not working.

Dan


 
Reply With Quote
 
Michael Winter
Guest
Posts: n/a
 
      12th Dec 2005
On 12/12/2005 09:34, Daniel Crichton wrote:

[snip]

> Are you running any personal firewall software, pop-up stopper, or
> anti-virus software that is masking/changing your User-Agent string?


Nope. I wouldn't have thought that that would affect conditional
comments, anyway. However, you did remind me to post my user-agent and
version number, which I meant to do in the OP.

Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; DigExt; SV1; .NET CLR
1.0.3705; .NET CLR 1.1.4322)

Version: 6.0.2900.2180.xpsp_sp2_gdr.050301-1519

> I've just look at your page with IE6 (latest patches) on XP SP2 (latest patches)
> and it shows the correct result.


Well, at least it isn't a general problem, though I'm still none the wiser.

Thank you both, Daniel and Rob.

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
 
Reply With Quote
 
Daniel Crichton
Guest
Posts: n/a
 
      12th Dec 2005
Michael wrote on Mon, 12 Dec 2005 14:24:33 GMT:

> On 12/12/2005 09:34, Daniel Crichton wrote:
>
> [snip]
>
>> Are you running any personal firewall software, pop-up stopper, or
>> anti-virus software that is masking/changing your User-Agent string?

>
> Nope. I wouldn't have thought that that would affect conditional comments,
> anyway. However, you did remind me to post my user-agent and version
> number, which I meant to do in the OP.


Hmm, good point, my brain was in "server side processing" mode.

> Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; DigExt; SV1; .NET CLR
> 1.0.3705; .NET CLR 1.1.4322)
>
> Version: 6.0.2900.2180.xpsp_sp2_gdr.050301-1519


Mine is:

Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET
CLR 1.1.4322)

Version: 6.0.2900.2180.xpsp_sp2_gdr.050301-1519

The only difference there being the DigExt and SV1.


>> I've just look at your page with IE6 (latest patches) on XP SP2 (latest
>> patches) and it shows the correct result.

>
> Well, at least it isn't a general problem, though I'm still none the
> wiser.


Nor me. Something internal to IE, possibly some compatibility option you've
turned on for testing (maybe inadvertently).

Dan


 
Reply With Quote
 
Robert Aldwinckle
Guest
Posts: n/a
 
      12th Dec 2005
"Michael Winter" <(E-Mail Removed)> wrote in message
news:RTYmf.6739$(E-Mail Removed)
....
> <http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp>



Try the Show me... example on that page?

What happens with it?

In case it works notice that one difference is in the DOCTYPE headers.


> [2] <http://mwinter.webhop.info/conditional-comments.html>



Also instead of User-Agent per se perhaps a more significant
diagnostic would be

javascript:navigator.appVersion


You can get another set of browser information from

http://www.fiddlertool.com/useragent.aspx

(though for all I know some of it may be just a parsing of a received
User-Agent string)

and here

http://gemal.dk/browserspy/basic.html


HTH

Robert Aldwinckle
---


 
Reply With Quote
 
Michael Winter
Guest
Posts: n/a
 
      13th Dec 2005
On 12/12/2005 16:04, Robert Aldwinckle wrote:

> "Michael Winter" <(E-Mail Removed)> wrote in message
> news:RTYmf.6739$(E-Mail Removed)
>
>> <http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp>

>
> Try the Show me... example on that page?
>
> What happens with it?


It works, but then it's only trying to evaluate 5.x or later, which is
what my IE 6 seems to think it is. If I save that and change the 5 to a
6, it fails again.

[snip]

> Also instead of User-Agent per se perhaps a more significant
> diagnostic would be
>
> javascript:navigator.appVersion


Exactly the same as the userAgent property, without "Mozilla/" at the start.

> You can get another set of browser information from
>
> http://www.fiddlertool.com/useragent.aspx
>
> (though for all I know some of it may be just a parsing of a received
> User-Agent string)


I believe it is (it uses HTTPBrowserCapabilities from ASP .NET). It's
certainly server-side, anyway.

> and here
>
> http://gemal.dk/browserspy/basic.html


Uses JScript. I could use conditional comments without any versioning,
then parse the User-Agent string knowing that I only need to check for
the version, but that would still leave the browser broken.

Last night, I even reinstalled XP2 (which is supposed to be /the/ way to
fix IE), getting infected with a virus in the process, and it still
thinks it's some version of IE 5. Looks like this won't get solved.

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
 
Reply With Quote
 
Michael Winter
Guest
Posts: n/a
 
      14th Dec 2005
On 11/12/2005 16:57, Michael Winter wrote:

[IE6 thinks it's IE5 when encountering conditional comments]

I found that the problem was caused by a corrupt registry value.

HKLM\SOFTWARE\Microsoft\Internet Explorer\Version Vector\IE

can be used to store the version number of IE. Though IE also knows its
own value internally (however, the number is apparently wrong with
IE5.5), it will defer to the registry if the value exists. For some
reason, this was set to 5.0002.

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
conditional formatting and comments puting_uwak Microsoft Excel Misc 5 25th Jun 2009 07:55 AM
Identifying Conditional Format David Benson Microsoft Excel Programming 2 8th Jan 2009 11:44 PM
Conditional comments Gary Wardell Windows XP Internet Explorer 1 26th Jul 2008 12:10 AM
Conditional Format - Identifying Highlighted Cells pallaver Microsoft Excel Misc 9 9th Jul 2008 02:18 AM
VBA Identifying Active Conditional Formatting carlsore Microsoft Access 0 24th Jul 2007 04:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:31 AM.