jQuery/Javascript to detect OS without a plugin?

后端 未结 7 631
余生分开走
余生分开走 2020-11-27 16:40

I am looking for a way to detect the OS for a downloads page using jQuery or Javascript to recommend specific files for Mac vs Windows. I was hoping to do it without adding

7条回答
  •  温柔的废话
    2020-11-27 17:18

    I think this might help:

    navigator.appVersion
    

    Try consoling it in your JS file. For example:

    console.log(navigator.appVersion);
    

    You'll get most of the info regarding OS.

提交回复
热议问题