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

ann*_*mae 0 iphone mootools android detection

是否有Mootools方式来检测iPhone/Android /其他?我有这个Vanilla 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';
}
Run Code Online (Sandbox Code Playgroud)

我知道如何为浏览器(jsfiddle,但不是智能手机)这样做.
任何帮助都会受到欢迎.

ari*_*ian 6

只需查看文档:http://www.mootools.net/docs/core/Browser/Browser

  • Browser.Platform.ios - (boolean)如果平台是iOS,则为True.
  • Browser.Platform.webos - (boolean)如果平台是WebOS,则为True
  • Browser.Platform.android - (boolean)如果平台是Android,则为True