简体   繁体   中英

Detect Windows XP in Firefox with JS

I am using the following code to detect if the client has Windows XP:

if(navigator.appVersion.indexOf('Windows NT 5.1') > -1)
        $('#isXP').modal('show');

This works perfectly on Chrome and IE. But not in IE8 and Firefox.

Any idea how can I detect it?

您也可以像下面这样导航:navigator.userAgent:

navigator.userAgent.indexOf('Windows NT 5.1') != -1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM