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
+19.7k Swift : Convert (cast) Int to int32 or Uint32
+8.3k Golang : Set or add headers for many or different handlers
+22.7k Golang : Randomly pick an item from a slice/array example
+8.5k Golang : HTTP Routing with Goji example
+22.6k Golang : Gorilla mux routing example
+6.3k Golang : Join lines with certain suffix symbol example
+6.4k Golang : Find the longest line of text example
+11.2k Golang : Handle API query by curl with Gorilla Queries example
+13.4k Golang : Check if an integer is negative or positive
+21.5k Golang : Use TLS version 1.2 and enforce server security configuration over client
+7.2k Golang : Detect sample rate, channels or latency with PortAudio
+9.1k Golang : Find the length of big.Int variable example