Javascript examples for Browser Object Model:Navigator
detecting user language in Chrome Browser, Mozilla and IE
<html> <head> <title>Browser Language detection</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//from ww w. j a v a2s . c o m console.log(window.navigator.language);//works both in Mozilla and chrome console.log(navigator.language);//works both in Mozilla and chrome console.log(navigator.userLanguage);// Works in IE } </script> </head> <body> </body> </html>