0

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?

Hillel Garcia
  • 109
  • 12
  • Try this reference http://stackoverflow.com/questions/11219582/how-to-detect-my-browser-version-and-operating-system-using-javascript – Sasikumar Sep 13 '16 at 07:11
  • The solution of this example has the same code as mine, and assumes the code works in all browsers. – Hillel Garcia Sep 13 '16 at 07:17

1 Answers1

3

you can also you navigator.userAgent, like so:

navigator.userAgent.indexOf('Windows NT 5.1') != -1
Hillel Garcia
  • 109
  • 12
Beginner
  • 4,118
  • 3
  • 17
  • 26