目前主流的操作系统有三个: Windows / MacOS / Linux. 想要用JavaScript判断其所在的操作系统可以通过: navigator.platform 实现;

navigator.platform; // "Win32"

返回值一般有下面三种: 

1. Windows: "Win32"

2. MacOS: "MacIntel"

3. Linux: "Linux x86_64"

 

注意: 不能通过这个方法去获取移动设备如手机的操作系统

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-30
  • 2022-12-23
  • 2022-12-23
  • 2022-01-06
  • 2021-11-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-20
  • 2022-12-23
  • 2021-08-10
相关资源
相似解决方案