The lowercase information for the UserAgent property of the Navigator object is obtained first, and then the value is inferred from the regular table.
var Sys = {};var ua = Navigator.userAgent.toLowerCase (); var s;var scan; (s = Ua.match (/msie ([\d.] +)/)) ? sys.ie = S[1]: (s = Ua.match (/firefox\/([\d.] +)/)) ? Sys.firefox = S[1]: (s = Ua.match (/chrome\/([\d.] +)/)) ? Sys.chrome = S[1]: (s = Ua.match (/opera. ( [\d.] +)/)) ? Sys.opera = S[1]: (s = Ua.match (/version\/([\d.] +). *safari/))? Sys.safari = s[1]: 0;//to test if (sys.ie) {scan = "ie kernel you use" + sys.ie + "browser";} if (sys.firefox) {scan = "You are using the Firefox kernel" + sys.firefox + "browser";} if (sys.chrome) {scan = "You are using the chrome kernel" + sys.chrome + "browser";} if (sys.opera) {scan = "You are using the Opera kernel" + Sys.opera + "browser";} if (Sys.safari) {scan = "You are using the Safari kernel" + Sys.safari + "browser";} Alert (scan)
Itmyhome
JS Check Browser type and version number