|
#1
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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" <m.winter@blueyonder.co.uk> wrote in message news:RTYmf.6739$iz3.3277@text.news.blueyonder.co.u k... > 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. |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
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 |
|
#5
|
|||
|
|||
|
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. |
|
#6
|
|||
|
|||
|
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 |
|
#7
|
|||
|
|||
|
"Michael Winter" <m.winter@blueyonder.co.uk> wrote in message
news:RTYmf.6739$iz3.3277@text.news.blueyonder.co.u k .... > <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 --- |
|
#8
|
|||
|
|||
|
On 12/12/2005 16:04, Robert Aldwinckle wrote:
> "Michael Winter" <m.winter@blueyonder.co.uk> wrote in message > news:RTYmf.6739$iz3.3277@text.news.blueyonder.co.u k > >> <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. |
|
#9
|
|||
|
|||
|
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. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Identifying Missing Files? | dlowrey | Windows Media Player | 6 | 01-05-2006 04:11 PM |
| sending comments | David F. Smith | Windows XP Messenger | 0 | 01-05-2006 07:49 AM |
| What apps uses the file attributes: title, subject, author, keywords, comments? | peter | Windows XP Photos | 1 | 01-05-2006 07:11 AM |
| Metadata, Oh Metadata! JPEG comments, IPTC, Exif | DaveC | Windows XP Photos | 6 | 01-05-2006 07:09 AM |
| Have results from Hijackthis. Don't understand them!!! 1st half | StanStan | Windows XP General | 15 | 01-05-2006 02:36 AM |