首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

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

2013-04-02 
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. ????} ?

热点排行