Forum Moderators: open

Message Too Old, No Replies

detecting Mac OS 9 from OS X

is this possible at all?

         

Lost

10:59 pm on May 10, 2002 (gmt 0)



I have found that MS Explorer in Mac OS 9 and OS X were not exactly created equally, despite claims that they are. Because of this, I need to find some way to differentiate between the two of them using a javascript, as my stylesheets are not working the same on both.

Trouble is, using the following script, I still can't distinguish the two from each other as both browsers respond the same whether I use "5." < as the version or "5.11" <. Does this make any sense?

<SCRIPT LANGUAGE="JavaScript">
<!--

if ((navigator.appVersion.indexOf("Mac") != -1) && (navigator.appName.indexOf("MSIE") != -1) && (navigator.appVersion.indexOf("5.12") < -1)) {
document.write("<LINK REL=stylesheet HREF=\"mainstyles-ie5.css\" TYPE=\"text/css\">"); }

else {
document.write("<LINK REL=stylesheet HREF=\"mainstyles.css\" TYPE=\"text/css\">"); }
// -->
</SCRIPT>

From what I've read, Explorer v5.1.4 in OS X refers to itself as 5.1.2 for some reason, so I thought I could use that to my advantage, but IE5.0 in OS 9 doesn't get it when I define it that way.

HEEELLLLLLLP!

Lost

11:05 pm on May 10, 2002 (gmt 0)



I guess what I forgot to mention in my question above was: does someone know of another (better) way to distinguish between these two browser versions or is there a way to detect between OS 9 and OS X?

Things I've tried: both are Javascript v1.4 - can't use that; both respond to being referred to as MSIE v5.0; I have so far found that you can distinguish between "Mac 68k" and "Mac PPC" only...

Thanks!! :)