Can someone help me figure out how to show a hidden layer *ONLY* if the
browser is IE for windows? I want it to remain hidden for everything else,
Netscape, Opera, Mozilla and anything for Mac. I'm not having much luck
out here.
While I can't help to wonder why you would want that, here are some
suggestions.
Since you only care about IE, you might only care about some IE versions.
In IE 5 and later, you can use conditional comments:
<!--[if IE]>
<div id='hidden'>
...
</div>
<![endif]-->
All other browsers will only see HTML-comments. (I don't *think* IE 5.2/Mac
will understand conditional comments).
<URL:
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/ccomment_ovw.asp>
Otherwise, you must find a way to uniquely identify IE/Win. It has
been discussed before, and the conclusion was that object detection is
not a safe way to detect IE. Other browsers emulate IE in any way they
can, including lying about their name in navigator.appName etc. If you
find a feature that distinguishes IE from other browsers, chances are
another browser will emulate that feature sooner or later.
So far, no browser have implemented conditional comments. Maybe one
will eventually. It is what I would use, and not care about IE4.
/L