Revisions
-
anhr revised this gist
Aug 4, 2015 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,9 @@ // The same thing but for IE Mobile instead. // I see "Unable to get property '1' of undefined or null reference" // because // /IEMobile\/(\d+\.?(\d+)?)/.exec( navigator.userAgent ) is null // if "IEMobile" string is not exists in the navigator.userAgent. // I have used a code below for resolving of problem: var ieMobile = /IEMobile\/(\d+\.?(\d+)?)/.exec( navigator.userAgent ); ieMobile = ( !! window.ActiveXObject && ieMobile && (ieMobile.length >= 2) && +( ieMobile[1] ) ) || NaN; -
jalbertbowden renamed this gist
Mar 16, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
jalbertbowden revised this gist
Mar 16, 2013 . 3 changed files with 20 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,18 @@ // ie === 6 // IE6 // ie > 7 // IE8, IE9 ... // ie < 9 // Anything less than IE9 // script needs to be wrapped on conditional comments to exclude > ie9 // appends class of "ieX" where X is version number, to document's html element // ie8 demo http://dev.bowdenweb.com/ua/browsers/ie/ie8-detection.html // ie9 demo http://dev.bowdenweb.com/ua/browsers/ie/ie9-detection.html var ie = ( !!window.ActiveXObject && +( /msie\s(\d+)/i.exec( navigator.userAgent )[1] ) ) || NaN; if (ie === 6) { document.documentElement.className+=' ie6'; } else if (ie === 7) { document.documentElement.className+=' ie7'; } else if (ie === 8) { document.documentElement.className+=' ie8'; } else if (ie === 9) { document.documentElement.className+=' ie9'; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ // ie10 doesn't support conditional comments but it does support @cc_on // @cc_on activates conditional comments within a script // appends class of "ie10" to the document's html element // http://msdn.microsoft.com/en-us/library/8ka90k2e%28v=vs.94%29.aspx // demo http://dev.bowdenweb.com/ua/browsers/ie/ie10-detection-via-cc.html <!--[if !IE]><!--><script>if(/*@cc_on!@*/false){document.documentElement.className+=' ie10';}</script><!--<![endif]--> -
jalbertbowden revised this gist
Mar 16, 2013 . 1 changed file with 10 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ // ie10 doesn't support conditional comments but it does support @cc_on // @cc_on activates conditional comments within a script // http://msdn.microsoft.com/en-us/library/8ka90k2e%28v=vs.94%29.aspx <style> .ie10{} </style> <!--[if !IE]><!--<script> if (/*@cc_on!@*/false) { document.documentElement.className+=' ie10'; } </script><!--<![endif]--> -
peteboere revised this gist
Oct 3, 2012 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ // The same thing but for IE Mobile instead. var ieMobile = ( !! window.ActiveXObject && +( /IEMobile\/(\d+\.?(\d+)?)/.exec( navigator.userAgent )[1] ) ) || NaN; -
Pete Boere revised this gist
Apr 15, 2011 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,4 +16,4 @@ // ---------------------------------------------------------- var ie = ( !!window.ActiveXObject && +( /msie\s(\d+)/i.exec( navigator.userAgent )[1] ) ) || NaN; -
Pete Boere revised this gist
Feb 7, 2011 . 1 changed file with 7 additions and 21 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,11 @@ // ---------------------------------------------------------- // A short snippet for detecting versions of IE: // Uses a combination of object detection and user-agent // sniffing. // ---------------------------------------------------------- // If you're not in IE then: // ie === NaN // falsy // If you're in IE then you can determine which version: // ie === 7; // IE7 // Thus, to detect IE: // if (ie) {} @@ -14,20 +15,5 @@ // ie < 9 // Anything less than IE9 // ---------------------------------------------------------- var ie = ( !!win.ActiveXObject && +( /msie\s(\d+)/i.exec( ua )[1] ) ) || NaN; -
padolsey revised this gist
Aug 21, 2010 . 1 changed file with 0 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,8 +18,6 @@ var ie = (function(){ var undef, v = 3, div = document.createElement('div'), -
padolsey revised this gist
Aug 21, 2010 . 1 changed file with 2 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,14 +15,13 @@ // ---------------------------------------------------------- // UPDATE: Now using Live NodeList idea from @jdalton var ie = (function(){ if (/*@cc_on!@*/true) return undef; var undef, v = 3, div = document.createElement('div'), all = div.getElementsByTagName('i'); @@ -31,6 +30,6 @@ var ie = (function(){ all[0] ); return v > 4 ? v : undef; }()); -
padolsey revised this gist
Aug 20, 2010 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ // ie < 9 // Anything less than IE9 // ---------------------------------------------------------- // UPDATE: Now using Live NodeList idea from @jdalton // and conditional compilation early exit from Scott Jehl var ie = (function(){ -
padolsey revised this gist
Aug 20, 2010 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,7 @@ // ---------------------------------------------------------- // A short snippet for detecting versions of IE in JavaScript // without resorting to user-agent sniffing // ---------------------------------------------------------- // If you're not in IE (or IE version is less than 5) then: // ie === undefined // If you're in IE (>=5) then you can determine which version: -
padolsey revised this gist
Aug 20, 2010 . 1 changed file with 13 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,15 +11,23 @@ // ie < 9 // Anything less than IE9 // ---------------------------------------------------------- // UPDATE: Now using Live NodeList idea from @Dalton // and conditional compilation early exit from Scott Jehl var ie = (function(){ if (/*@cc_on!@*/true) return undef; var undef, v = 4, div = document.createElement('div'), all = div.getElementsByTagName('i'); while ( div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->', all[0] ); return v; }()); -
padolsey revised this gist
Aug 17, 2010 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ // ---------------------------------------------------------- // If you're not in IE (or IE version is less than 5) then: // ie === undefined // If you're in IE (>=5) then you can determine which version: // ie === 7; // IE7 // Thus, to detect IE: // if (ie) {} -
padolsey revised this gist
Aug 16, 2010 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,14 +6,14 @@ // Thus, to detect IE: // if (ie) {} // And to detect the version: // ie === 6 // IE6 // ie > 7 // IE8, IE9 ... // ie < 9 // Anything less than IE9 // ---------------------------------------------------------- var ie = (function(){ var undef, v = 3, div = document.createElement('div'); while ( div.innerHTML = '<!--[if gt IE '+(++v)+']><i></i><![endif]-->', -
padolsey revised this gist
Aug 16, 2010 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,9 +6,9 @@ // Thus, to detect IE: // if (ie) {} // And to detect the version: // ie && ie === 6 // IE6 // ie && ie > 7 // IE8, IE9 ... // ie && ie < 9 // Anything less than IE9 // ---------------------------------------------------------- var ie = (function(){ -
padolsey created this gist
Aug 16, 2010 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ // ---------------------------------------------------------- // If you're not in IE (or IE version is less than 5) then: // ie === undefined // If you're in IE (>5) then you can determine which version: // ie === 7; // IE7 // Thus, to detect IE: // if (ie) {} // And to detect the version: // ie === 6 // IE6 // ie > 7 // IE8, IE9 ... // ie < 9 // Anything less than IE9 // ---------------------------------------------------------- var ie = (function(){ var undef, v = 4, div = document.createElement('div'); while ( div.innerHTML = '<!--[if gt IE '+(++v)+']><i></i><![endif]-->', div.getElementsByTagName('i')[0] ); return v > 4 ? v : undef; }());