How do I determine if my device is IOS?

Asked 1 years ago, Updated 1 years ago, 79 views

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

2022-09-22 22:07

1 Answers

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.


2022-09-22 22:07

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.