通过js检测iphoneipad或ipod

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了通过js检测iphoneipad或ipod相关的知识,希望对你有一定的参考价值。

Was using this to disable certain js functionality as it wasnt working on apple's webkit
  1. function appleMobileChk(){
  2. if (/iPhone/.test(navigator.userAgent) || /iPad/.test(navigator.userAgent) || /iPod/.test(navigator.userAgent)){
  3. return true;
  4. }
  5. else{
  6. return false;
  7. }
  8. }

以上是关于通过js检测iphoneipad或ipod的主要内容,如果未能解决你的问题,请参考以下文章

iPhoneipad回收价格

检测 iPhone/iPad/iPod touch 的颜色?

检测 iPhone/iPad/iPod touch 的颜色?

iPod touch 检测不到耳机

js代码片段

检测 iPhone iPad 等是不是不工作