I wanted to know what the main difference between the two feature and feature inference forms >
I wanted to know what the main difference between the two feature and feature inference forms >
Feature detection is to verify that the function is available to be used explicitly.
Feature inference is to check if a function is available and, based on that, assume that another function is also available.
Feature Detection:
if (window.XMLHttpRequest) {
new XMLHttpRequest();
}
Feature inference:
if (document.getElementsByTagName){
element = document.getElementById(id);
}
Source: Question SO In