Tent - Feature Detect Events
by darcyclarke
JavaScript
var Tent = {};
var types = 'DOMAttrModified',root = document.documentElement, support = root.addEventListener ?
(function() {
types = types.split(" ");
for(type in types){
var e, l, f = false;
l = root.id;
e = function() {
root.removeEventListener(type, e, false);
NATIVE_MUTATION_EVENTS = true;
root.id = l;
};
root.addEventListener(type, e, false);
root.id = 'nw';
f = root.id != 'nw';
root.id = l;
support[type] f;
}
})() :
false;
console.log(support);