Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1042 How can I distinguish between MAC and WinNT?

You are here: irt.org | FAQ | JavaScript | Misc | Q1042 [ previous next ]

You can interrogate the navigator objects appVersion property:

<script language="JavaScript"><!--
function platform() {
    var version = navigator.appVersion;
    if (version.toLowerCase.indexOf('mac') > -1)
        return 'Mac';
    if (version.toLowerCase.indexOf('nt') > -1)
        return 'NT';
    else
        return 'other';
}

alert(platform());
//--></script>

©2018 Martin Webb