KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Im developing a javaScript code and I want to determine the version and brand of the client's browser, here's the piece of code I'm using to do so : var browserName ; function BrowserCheckin () { if(navigator.userAgent.indexOf("Mozilla") > 0 ) browserName = "Mozilla" ; if (navigator.userAgent.indexOf("MSIE") > 0 ) browserName = "InternetExplorer"; if (navigator.userAgent.indexOf("Chrome") > 0) browserName= "Google Chrome" ; if(navigator.userAgent.indexOf("Opera") > 0 ) browserName = "Opera" ; document.write("<h1>" + browserName + "</h1>") ; } but when i run my code using "Google Chrome" , the useAgent property returns a string containting : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30 " But I don't get what that "Mozilla/5.0" is doing there , anyone has any Idea ? (and one more thing , I use Linux as my Operating System) Thanks in advance :)
Tags (comma-separated)
Save Edits
Cancel