Javascript : Get operating system and browser information
Problem :
You need to find out your visitor's browser and os version. How to do that with Javascript or Jquery?
Solution :
The existing Javascript solution floating around forums can be easily spoofed and some have not been updated for years. To detect the visitors' browser accurately, please use WhichBrowser. It can detect mobile based browsers as well.
Follow the guidelines on how to install WhichBrowser at Github ( https://github.com/WhichBrowser/WhichBrowser#how-to-use-it )
and after installations... to detect the visitors' browser :
Browsers.browser
// Chrome 27
and to detect the visitors' OS version.
Browsers.os
// Mac OS X 10.8.4
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+7.3k Golang : Rename part of filename
+9.5k Golang : Load ASN1 encoded DSA public key PEM file example
+23k Golang : Print out struct values in string format
+5.2k Javascript : How to loop over and parse JSON data?
+9.6k Golang : Get current, epoch time and display by year, month and day
+10.7k Golang : Fix go.exe is not compatible with the version of Windows you're running
+14.9k Golang : Accurate and reliable decimal calculations
+40.7k Golang : How to check if a string contains another sub-string?
+11.6k Golang : Convert(cast) bigint to string
+10.9k Golang : Intercept and process UNIX signals example
+29k Golang : Record voice(audio) from microphone to .WAV file
+8.8k Golang : Serving HTTP and Websocket from different ports in a program example