iPhone/Android/etc检测,Mootools方式?
有没有一种方法可以检测iPhone/Android/others? 我有一个香草JS脚本:iPhone/Android/etc检测,Mootools方式?,iphone,android,mootools,detection,Iphone,Android,Mootools,Detection,有没有一种方法可以检测iPhone/Android/others? 我有一个香草JS脚本: if ( navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/BlackBerry/i) || navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/Palm/i) ) { window.location = 'address-to-ip
if ( navigator.userAgent.match(/Android/i) || navigator.userAgent.match(/BlackBerry/i) ||
navigator.userAgent.match(/iPhone/i) ||
navigator.userAgent.match(/Palm/i) )
{
window.location = 'address-to-iphone-site';
}
我知道如何在浏览器上做到这一点,但不知道如何在智能手机上做到这一点。欢迎任何帮助。只需查看文档:
- Browser.Platform.ios-(布尔值)如果平台是ios,则为True
- Browser.Platform.webos-(布尔值)如果平台是webos,则为True
- Browser.Platform.android-(布尔值)如果平台是android,则为True
- Browser.Platform.ios-(布尔值)如果平台是ios,则为True
- Browser.Platform.webos-(布尔值)如果平台是webos,则为True
- Browser.Platform.android-(布尔值)如果平台是android,则为True