Question : javascript detect ios device
Answered by : code-grepper
function isIOSDevice(){ return !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);
}
if(isIOSDevice()){ console.log("I am an IOS device!");
}
Source : | Last Update : Mon, 12 Aug 19
Question : detect device ios or android javascript
Answered by : annoying-anteater-plh2mpbbzbhs
function getOS() { var uA = navigator.userAgent || navigator.vendor || window.opera; if ((/iPad|iPhone|iPod/.test(uA) && !window.MSStream) || (uA.includes('Mac') && 'ontouchend' in document)) return 'iOS'; var i, os = ['Windows', 'Android', 'Unix', 'Mac', 'Linux', 'BlackBerry']; for (i = 0; i < os.length; i++) if (new RegExp(os[i],'i').test(uA)) return os[i];
}
Source : https://stackoverflow.com/questions/21741841/detecting-ios-android-operating-system | Last Update : Mon, 22 Aug 22