Advertisement
Alhadis

IE Version Flagging

Mar 16th, 2015
430
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /** Store "constants" on the window object to flag specific versions of Internet Exploiter. */
  2. (function(win){
  3.     for(var i = 6; i < 10; ++i){
  4.         if(function(v){
  5.             var d       =   document.createElement("div");
  6.             d.innerHTML =   "<!--[if IE "+v+"]><i></i><![endif]-->";
  7.             return d.getElementsByTagName("i").length;
  8.         }(i))
  9.  
  10.         win["IS_IE"+i]      =   true,
  11.         win["IE_VERSION"]   =   i;
  12.     }
  13. }(window));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement