You are here: irt.org | FAQ | JavaScript | Misc | Q140 [ previous next ]
The following works in Netscape 4 and Explorer 4:
<SCRIPT LANGUAGE="JavaScript1.2"><!-- if (navigator.appName == 'Netscape') var language = navigator.language; else var language = navigator.browserLanguage; var code = language.substring(0,2); //--></SCRIPT>