|
|
Q21 Can I detect the language set in user's browser?
irt.org | Knowledge Base | JavaScript | Misc | Q21 [ previous next ] Q21 Can I detect the language set in user's browser?Depending on whether the users browser is using a particular language then it is possible to detect this by analysing the navigator.userAgent for characters with right angle brackets: [ ]. For example, on my browser the userAgent returns the following: Mozilla/4.0 [en] (Win95; I) This can be retrieved using:
Since this was answered, you can now make use of the Navigator objects language or browserLanguage property, i.e. navigator.language, navigator.browserLanguage. See http://www.irt.org/articles/js082/index.htm for further details. |
-- div -->
|