재우니의 블로그

 

 

Such objects for versions of IE up to 10 inclusive are listed in the following table.

 

IE versions Supported standard object
10+ window.atob
9+ document.addEventListener
8+ document.querySelector
7+ window.XMLHttpRequest
6+ document.compatMode

By checking existence of these objects and combining such checks when needed, it is possible to reliably filter a specific IE version or a range of IE versions up to 10 inclusive.

This technique works reliably including cases when code minification is used.

The following table contains ready-to-use conditions.

IE versions Condition to check for
10 or older document.all
9 or older document.all && !window.atob
8 or older document.all && !document.addEventListener
7 or older document.all && !document.querySelector
6 or older document.all && !window.XMLHttpRequest
5.x document.all && !document.compatMode