function isSupported() { var element = document.createElement("div"); return typeof element.uniqueNumber == "number" && typeof document.documentElement.uniqueNumber == "number" && element.uniqueNumber != document.documentElement.uniqueNumber; } var Storage = {}; Index data by unique element identi er
Many of these attributes and properties are deprecated...but browsers still support them. If you’re writing a general solution, you’ve committed yourself to supporting them as well.
Targeted, low-level utility libraries Stop writing library plug-ins General libraries are abstraction layers with a different syntax Don’t aim for identical experiences across every browser Learn and target DOM APIs instead Save cross-browser consistency for low-level methods
“Any change to a low-level abstraction propagates to its dependencies.” “Before attempting to x any bug, the author must rst get an understanding of the problems caused by their code.” — Garrett Smith