Feature detection (web development): Difference between revisions

Content deleted Content added
Undetectables: Fixed typo
Tags: Mobile edit Mobile app edit
Line 11:
A feature test can take many forms. It is essentially ''any'' snippet of code which gives some level of confidence that a required feature is indeed supported. However, in contrast to other techniques, feature detection usually focusses on performing actions which directly relate to the feature to be detected, rather than [[heuristics]].{{Citation needed|date=March 2014}}
 
As [[JavaScript]] is the most prevelentprevalent [[scripting language]] in web browsers{{Citation needed|date=March 2014}}, many feature detection techniques use JavaScript to inspect the [[Document Object Model|DOM]] and local JavaScript environment.
 
The simplest technique is to check for the existence of a relevant object or property. For example, the Geolocation API (used for accessing the device’s knowledge of its geographical ___location, possibly obtained from a [[GPS navigation device]]) exposes a <code>geolocation</code> property on the <code>navigator</code> object in the DOM; the presence of which implies the Geolocation API is supported: