检测浏览器超过两年前 [英] Detect Browsers older than two years

查看:95
本文介绍了检测浏览器超过两年前的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一家私营公司网站,查看有关10,000个用户。

This is for a private company site with about 10,000 users.

我见过一对夫妇对浏览器检测,但没有与浏览器的时代努力,没有任何人有这样的想法?

I've seen a couple of efforts for browser detection but nothing with the age of the browser, does anyone have an idea for this?

相关项目:

  • http://fresh-browsers.com/en
  • https://github.com/Groozly/Fresh-Browsers
  • http://jquery.thewikies.com/browser/

到目前为止,我在想客户端,但如果有任何服务器端选项我接受这一点。

So far I was thinking client side but if there are any server side options I'm open to that as well.

不找凑网站。

他们希望升级浏览器,目前想放弃对浏览器的支持年长超过两年

They are looking to upgrade browsers and currently want to drop support for browsers older than two year

推荐答案

您打算这一切的错误的方式。你不支持浏览器,支持的功能。浏览器不会过期像豆子会在你的厨房一个即可。开发时使用的功能检测和polyfills - 这将追溯提供给浏览器10岁的支持

You're going about it all the wrong way. You don't support browsers, you support features. Browsers don't expire like a can of beans would in your pantry. Use feature detection and polyfills when developing - this will retroactively provide support to browsers 10 years old.

各种工具存在,以帮助可能缺乏的功能部门,你支持的浏览器。一种流行的一种是Modernizr的。这不仅暴露出的对象,告诉你40关于用户代理能够不同的东西,它也polyfills HTML5标记的一个子集,并附加信息CSS类名到您的文档,让你的风格对浏览器的支持或不要'T支持任何给定功能。

Various tools exist to help you support browsers that may be lacking in the feature department. One popular one is Modernizr. Not only does this expose an object that tells you over 40 different things about what the user agent is capable of, it also polyfills a subset of HTML5 tags, and attaches informative CSS classnames to your document that let you style against browsers that support or don't support any given feature.

使用大的做法是这样最终会导致您的客户提供更好的体验,改进了对你的雇主声誉,少沮丧​​你不必试图找出一些神奇的前pression确定一个露脸的古风一些可变的用户代理字符串的浏览器。

Using great practices like this will ultimately result in a better experience for your clients, improved reputation for your employer, and less frustration for you having to try and figure out some magical expression for determining the antiquity of a faceless browser by some mutable user agent string.

这篇关于检测浏览器超过两年前的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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