I need if it is possible to obtain the following information from a user of my website:
- What browser do you use?
- What country are you applying from?
- What language does the user handle?
- If possible the IP address
this for the purpose of keeping a record for statistics.
Regarding the browser information, when I execute var nav = navigator.userAgent.toLowerCase().indexOf('chrome');
it, it does not generate results and I have realized that the property navigator
brings with it the information that I need, but I am not sure if I am using it correctly since using it in another way window.navigator.language;
does not generate results either.
It's an old question but here's the answer (requires JQuery):