Feature detection (web development)

From Wiki @ Karl Jones dot com
Jump to: navigation, search

Feature detection (also feature testing) is a technique used in web development for handling differences between runtime environments (typically web browsers or user agents), by programmatically testing for clues that the environment may or may not offer certain functionality.

Description

This information is then used to make the application adapt in some way to suit the environment: to make use of certain APIs, or tailor for a better user experience.

Its proponents claim it is more reliable and future-proof than other techniques like user agent sniffing and browser-specific CSS hacks.

Cross-browser compatibility

Feature detection is used in cross-browser compatibility libraries, such as Modernizr.

See also

External links