Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q140 Is there a way of telling which language the users browser is using?

irt.org | Knowledge Base | JavaScript | Misc | Q140 [ previous next ]

Q140 Is there a way of telling which language the users browser is using?

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>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.