JavaScript functions browser compatibility
How can I check which functions of JavaScript the browser support which I am using? It can be any browser.开发者_如何学编程
This is what jQuery.support is for :) $.support
provides a feature list, that different browsers may or may not support, and if you're using something that is inconsistent, this will help.
$.browser
was the old way, which tells you which browser you're on, but don't use this to detect features. By using $.browser
and saying, well this is IE8 it can't do that...that may change via an update tomorrow, that's why feature detection is a much better way to go, which $.support
assists with.
You don't :)
The whole point of using a Javascript library like jQquery is to avoid the necessity for doing this. They provide an abstraction layer that hides the specific implementation of Javascript across browsers, as well as providing many methods allowing you to use much less code than you would to do the same thing in standard Javascript.
精彩评论