由于 jQuery.browser 自 1.9 以来已被删除,因此我遇到了很多麻烦,因为许多插件没有更新并且仍然使用该功能,尽管当前的 jQuery 版本中没有该功能。有没有推荐的方法来修改现有插件或任何其他建议?
最佳答案
The
jQuery.browser()
method has been deprecated since jQuery 1.3 and is removed in 1.9. If needed, it is available as part of the jQuery Migrate plugin. We recommend using feature detection with a library such as Modernizr
jQuery Migrate 1.1.1 Released :
Using the
jQuery Migrate
plugin is easy, just include it immediately after the script tag for jQuery, for example.<script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/jquery-migrate-1.1.1.js"></script>
关于javascript - 是否有任何类型的 jQuery.browser 后备?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15615437/