-
-
Save yelban/8c62a900f9cda96f2e30e7f0ac2089ce to your computer and use it in GitHub Desktop.
Check iOS version with Javascript
This file contains hidden or 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
| checkVersion = function () { | |
| var agent = window.navigator.userAgent, | |
| start = agent.indexOf( ‘OS ‘ ); | |
| if( ( agent.indexOf( ‘iPhone’ ) > -1 || agent.indexOf( ‘iPad’ ) > -1 ) && start > -1 ){ | |
| return window.Number( agent.substr( start + 3, 3 ).replace( ‘_’, ’.’ ) ); | |
| } | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment