JS判断终端(Android IOS)

function getMobileOperatingSystem() {
  var userAgent = navigator.userAgent || navigator.vendor || window.opera;
  if( userAgent.match( /iPad/i ) || userAgent.match( /iPhone/i ) || userAgent.match( /iPod/i ) ) {

  } else if( userAgent.match( /Android/i ) ) {

  }
}

  

posted @ 2016-04-14 09:17  roseforyou  阅读(214)  评论(0编辑  收藏  举报