Hillel Garcia
Hillel Garcia

Reputation: 109

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?

Upvotes: 0

Views: 842

Answers (1)

Beginner
Beginner

Reputation: 4153

you can also you navigator.userAgent, like so:

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

Upvotes: 3

Related Questions