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?

有帮助吗?

解决方案 2

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

其他提示

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
    }
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top