PhoneGap: Detect if running on desktop browser

后端 未结 30 2881
时光取名叫无心
时光取名叫无心 2020-11-29 15:47

I\'m developing a web application that uses PhoneGap:Build for a mobile version and want to have a single codebase for the \'desktop\' and mobile versions. I want to be able

30条回答
  •  感动是毒
    2020-11-29 16:06

    This works for me (running 1.7.0)

    if (window.device) {
      // Running on PhoneGap
    }
    

    Tested on desktop Chrome and Safari.

提交回复
热议问题