iPhone/Android/etc检测,Mootools方式?

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

有没有一种方法可以检测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-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
您可以用于移动浏览器检测和重定向。(免责声明:我运行手机检测)。希望这有帮助。

您可以用于移动浏览器检测和重定向。(免责声明:我运行手机检测)。希望这有帮助