Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
42
rated 0 times [  48] [ 6]  / answers: 1 / hits: 19880  / 11 Years ago, sun, september 1, 2013, 12:00:00

I'm going to detect user's keyboard language by javascript. I got a input (type of text) which should be filled with Persian characters. So, I need to alarm users change their keyboard language if their language is not Persian.



What I have found is this:



window.navigator.language;


which detects browser's language which is always En-us.



How could I solve that?


More From » html

 Answers
2

You can try like this:-



var language = window.navigator.userLanguage || window.navigator.language;
alert(language);


navigator.userLanguage works for IE



window.navigator.language works for firefox/opera/safari



Also check out this Thread


[#75971] Friday, August 30, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
sandy

Total Points: 59
Total Questions: 98
Total Answers: 98

Location: Falkland Islands
Member since Mon, Jul 13, 2020
4 Years ago
;