I want to check if the device is IOS and do different processing only if it is IOS. But how do I check if it's IOS?
javascript ios browser
var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
Do this or use the navigator.platform
var iOS = !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform);
There's a way to do this.
The value of IOS will be true or false.
© 2024 OneMinuteCode. All rights reserved.