-2

We host our site on MediaTemple's grid server, which allows you to install an SSL certificate even though it's shared hosting. We have a few forms on the site that are processing payments via Stripe, which makes this mandatory for us. The problem is, with this particular setup (grid server + SSL), users with IE8 and 7 on windows XP will see an error message warning them that the certificate could possibly be invalid. IE8 on Windows7 is fine. According to our analytics we don't have a ton of users on XP (not enough to make hosting changes worth it), but we do have a handful - so what I'd really love to be able to do is to serve up a message for those users, IE7 and 8, XP only, letting them know that they can continue through the error message or call us to finish the transaction if they are uncomfortable. I know I can get just IE7 and 8 users via conditional comments, but I don't want to scare away IE8 users on Windows7 unnecessarily, so I'd really like to be able to show to XP users only. Is there any possible way to sniff out XP users only?

user1851361
  • 107
  • 2
  • 9
  • 1
    You will get the price for the worlds worst tagging – Eric Herlitz Nov 24 '13 at 21:19
  • _"I don't want to scare away IE8 users on Windows7"_ - How many of those are there? Won't they be using IE9 or later? – nnnnnn Nov 24 '13 at 21:25
  • Eric - sorry! I really didn't know what to put..! – user1851361 Nov 24 '13 at 22:02
  • nnnnnn - I'd really like to think so, but unfortunately our analytics tell a different story for our specific site - probably has to do with our specific clients, a lot of very old-school bureaucracies making tech decisions, where everyone has to update at the same time (which really means, "not for years and years and years"). – user1851361 Nov 24 '13 at 22:05

2 Answers2

2
var UA = navigator.userAgent.toLowerCase(),
    IE = (UA.indexOf('msie') != -1) ? parseInt(UA.split('msie')[1], 10) : false;

if (IE && IE < 9 && IE > 7) {
    // IE 8
    if (UA.indexOf('windows nt 5.1') != -1 || UA.indexOf('windows xp') != -1) {
        // windows XP
    }
}
adeneo
  • 312,895
  • 29
  • 395
  • 388
0

Check the User-Agent-String for "Windows NT 5.1"

  • Thanks - got it to work looking for indexof Windows NT 5 - 5.1 might have been too specific, since the machine I'm using spit out 5.2 as the user agent, but thanks very much for pointing me in the right direction! – user1851361 Nov 24 '13 at 22:05