如何查看访问者是否正在使用其浏览器的最新版本? [英] How to check if a visitor is using the latest version of his/her browser?

查看:131
本文介绍了如何查看访问者是否正在使用其浏览器的最新版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一种简单,自动的方法来检查我的网站(用asp.net编写)的访问者是否正在使用其浏览器的最新版本?这将使我能够显示一条消息,通知他们他们正在运行旧版本,并且他们可能想要升级.

我的网站在大多数浏览器上都经过测试,但是我没有测试旧版本(例如Internet Explorer 6等).基本上,当我的一位访客使用这样的旧版本时,我想鼓励(而不是强迫他们)进行升级.

当然,我可以通过获取浏览器的版本并在数据库中进行查找来自己完成此操作,但我不想自己维护浏览器版本"数据库. 有什么想法吗?

解决方案

以网站用户的身份讲,如果我遇到一个建议我升级浏览器的网站,那将是对该网站的立即黑斑./p>

我可能无法升级(例如,如果要从公司网络访问);我可能有使用特定版本的特定原因(例如,如果我是一名Web开发人员,想要确保与我的用户社区的兼容性).

因此,就我个人而言,我会说一条通俗的免责声明,即您不要在较早的版本上测试此站点.这与您要做的技术挑战完全不同.


正如Yeti指出的那样,尽管我的担心仍然有效,但我没有直接回答问题.这是在 Pace的答案中完成的,他所指的w3schools资源为您提供了在客户端执行此操作所需的功能

Is there a simple and automatic way of checking if a visitor to my website (written in asp.net) is using the latest version of his browser? This would allow me to display a message to inform them that they're running an old version and that they might want to upgrade.

My website is tested on most broswers but I don't test old versions (such as Internet Explorer 6 etc). When one of my visitors is using such an old version, basically, I would like to encourage (not force) them to upgrade.

Of course I could do this myself by getting the version of the browser and look it up in my database but I don't want to have to maintain a 'browser version' database myself. Any ideas?

解决方案

Speaking as a user of websites, if I come across a site that advised me to upgrade my browser then that would be an immediate black mark against that site.

I might not be able to upgrade (if I'm accessing from a corporate network for example); I might have a specific reason for using a particular version (if I'm a web developer wanting to ensure compatibility with my user community for example).

So personally, I would say that a blanket disclaimer that you don't test this site on earlier versions would be the way to go. That's quite apart from the technical challenge of what you want to do.


Edit: as Yeti points out, however valid my concerns, I don't answer the question directly. This is done in Pace's answer, and the w3schools resource he points to gives you what you need to do this on the client side.

这篇关于如何查看访问者是否正在使用其浏览器的最新版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆