Skip to content

Instantly share code, notes, and snippets.

@RyoSugimoto
Created May 26, 2015 05:49
Show Gist options
  • Save RyoSugimoto/680cd12301a97ccfc7d3 to your computer and use it in GitHub Desktop.
Save RyoSugimoto/680cd12301a97ccfc7d3 to your computer and use it in GitHub Desktop.
iOSのバージョンを調べる。
var iOSversion = function () {
if (/iP(hone|od|ad)/.test(navigator.platform)) {
var v = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/);
return [parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || 0, 10)];
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment