Possible Duplicate:
What’s the replacement for $.browser
我依赖 jQuery 已弃用的 $.browser
对某些浏览器应用怪异修复的功能。示例:
if ($.browser.msie && $.browser.version < 9) {
此功能是 removed在 jQuery 1.9 中,所以我正在寻找替代方案。 jQuery 建议使用 Modernizr用于功能检测,但该插件似乎没有涵盖我需要的功能。此功能的(非)官方替代品是什么?
最佳答案
自 jQuery 1.3 起,jQuery.browser()
方法已被弃用,并在 1.9 中被删除
来自 jQuery API 文档:
Rather than using
$.browser
to detect the current user agent and alter the page presentation based on which browser is running, it is a good practice to use feature detection. To make this process simpler, jQuery performs many such tests and sets properties of thejQuery.support
object.
要进行更高级的功能检测,您应该 Modernizr正如@Pointy 所建议的。
关于javascript - $.browser.msie 在 jQuery 1.9 中不再工作。替代品在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14629861/