Feature detection (web development): Difference between revisions

Content deleted Content added
Stucox (talk | contribs)
Created page with ':"This article is about the web development technique. For the neurological process, see feature detection, or for the computer vision technique, see featu...'
 
Stucox (talk | contribs)
No edit summary
Line 1:
:"''This article is about the web development technique. For the neurological process, see [[feature detection]], or for the computer vision technique, see [[feature detection (computer vision)]]."''
 
'''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. This information is then used to make the application adapt in some way to suit the environment: to make use of certain [[API|APIs]], or tailor for a better user experience.{{Citation needed}}
Line 18:
// Geolocation API is supported
}</nowiki>
 
For a greater level of confidence, some feature tests
 
 
==Undetectables==
Line 28 ⟶ 25:
When undetectables are encountered, it is common to turn to [[User_agent#User_agent_sniffing]] as an alternative mechanism, or to employ [[defensive coding]] to minimise the impact if the feature turns out not to be supported.
 
The [[Modernizr]] project maintains a record of known undetectables on their [https://github.com/Modernizr/Modernizr/wiki/Undetectables wiki].
 
==See also==