I’ve found an article that explains how to detect IE “by checking existence of nonstandard document.all object available in IE only”.
Would this method be considered good practice? Is it stable and really future proof?
Here is the article: http://tanalin.com/en/articles/ie-version-js/
Also, don’t forgot the section of future proofing: http://tanalin.com/en/articles/ie-version-js/#h-future-proof
Here is the code suggested:
if (document.all && !document.querySelector) { // IE7 or lower
}
No
No
In general, browser detection is not good practice.
In those occasions when it is the best solution to a problem, and the browsers you need to detect are versions of IE, then Conditional Comments are the way to go.