js 判断 字符串包孕某字符串

js 判断 字符串包含某字符串function?getType(){??????????if(navigator.userAgent.indexOf(iPhone)?!?

js 判断 字符串包含某字符串

  1. function?getType(){??
  2. ????????if(navigator.userAgent.indexOf("iPhone")?!=?-1)?{??
  3. ????????????alert("我是iPhone~!");??
  4. ????????}??
  5. ????????if(navigator.userAgent.indexOf("iPad")?!=?-1){??
  6. ????????????alert("我是iPad~!");??????}??
  7. ????} ?