Last active
April 13, 2016 11:57
-
-
Save tiberiur/c26493f6f2fdb1674c17 to your computer and use it in GitHub Desktop.
[JS] Get browser version using navigator object.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getBrowserVersion() | |
{ | |
var findIndex; | |
var browserVersion = 0; | |
var browser = getBrowserName(); | |
browserVersion = navigator.userAgent; | |
findIndex = browserVersion.indexOf(browser) + browser.length + 1; | |
browserVersion = parseFloat(browserVersion.substring(findIndex, findIndex + 3)); | |
return browserVersion; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment