当我检查我的设备是 iPad 时,我得到了错误的值,我该怎么做;谁能帮我。我在下面提供了可以提供帮助的代码。
var isiDevice = /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase());
if (isiDevice)
{
CallFullScreen();
}
最佳答案
试试这个
if( !navigator.userAgent.match(/Android/i) && !navigator.userAgent.match(/webOS/i) && !navigator.userAgent.match(/iPhone/i) && !navigator.userAgent.match(/iPod/i) && !navigator.userAgent.match(/BlackBerry/i) ) {
you code goes here for samll device like iphone, androide.
}
关于javascript - 如何使用 jQuery 检测我的 iPad 设备,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29203698/