IE conditional comments not quite working

D

delerious

I've managed to find a computer with just IE 5.0 on it, so I'm trying to test
out my conditional comments. They're not quite working.

The browser version number is 5.00.2614.3500

Here are the conditional comments I have tried, and whether or not they work:

<!--[if IE 5]> this one should work, and it does work
<!--[if IE 5.0]> this one should work, but it does NOT work
<!--[if IE 5.0026143500]> this one should work, but it does NOT work
<!--[if IE 5.2]> this one should NOT work, but it DOES work

It looks like IE is ignoring the zeros after the 5, so that is why the check
for 5.2 works. Does this mean that if there is a build of IE 5.0 with version
number 5.00.5321.5900, then that build of IE 5.0 will pass a check for 5.5?

I have some HTML that must be displayed for IE 5.0 and not IE 5.5. So I
cannot use the <!--[if IE 5]> check.

Any ideas?
 
B

brucie

I've managed to find a computer with just IE 5.0 on it, so I'm trying to test
out my conditional comments.

you're really obsessing about particular browsers. stop it, its not
healthy.
 
R

Richard

I've managed to find a computer with just IE 5.0 on it, so I'm trying to
test out my conditional comments. They're not quite working.

Forget checking for browser and even more so the version.
What you need to do is check to see if the browser accepts the function or
not.
e.g.
if {document.images}

If it works, the function continues to load the images.
If not, the visitor suffers and waits.

Do you realize how many browsers there are and how many versions of each
one?
So you check your stats and you find 90% of your visitors using a browser
you never heard of.
Whatchya gonna do now?

Not to mention all that testing you need to do to find out if it works right
or not.
 
A

Andy Dingley

You do know that curly brackets are entirely invalid wrong there, right?

They're not _entirely_ invalid, just mis-used.

"Conditional comments" though are just another bizarre cargo cult from
M$oft. Square brackets [ ] have no meaning inside a comment and
pretending that they do (even if you happen to be His Satanic Billness
himself) will just end in frustration (although if you're HSB, it's
usually the others who get frustrated).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top