可以通过检测navigator.userAgent字段中是否有"mobi"字段来检测是PC浏览器还是手机浏览器: 

/mobi/i.test(window.navigator.userAgent.toLowerCase()) ? "手机浏览器" : "PC 浏览器"

 

相关文章:

  • 2022-12-23
  • 2022-02-24
  • 2022-12-23
  • 2022-12-23
  • 2022-02-03
  • 2021-11-21
  • 2021-12-13
  • 2021-12-30
猜你喜欢
  • 2021-11-30
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案