Just by using JavaScript and not conditional statements, I would like to detect the users version of IE and then display a message if it is any version
less than IE 9. This is what I have so far
Also there is this code, it looks cool but I am not really sure what the heck it does.Code:if(IE){ $(function(){ $("<div>") .css({ 'position': 'absolute', 'top': '0px', 'left': '0px', backgroundColor: 'black', 'opacity': '0.75', 'width': '100%', 'height': $(window).height(), zIndex: 5000 }) .appendTo("body"); $("<div><img src='no-ie.png' alt='' style='float: left;'/><p><br /><strong>Sorry! This page doesn't support Internet Explorer.</strong><br /><br />If you'd like to read our content please <a href='http://browsehappy.com/'>upgrade your browser</a></p>") .css({ backgroundColor: 'white', 'top': '50%', 'left': '50%', marginLeft: -210, marginTop: -100, width: 410, paddingRight: 10, height: 200, 'position': 'absolute', zIndex: 6000 }) .appendTo("body"); }); }
Code:var ie = (function(){ var undef, v = 3, div = document.createElement('div'); while ( div.innerHTML = '<!--[if gt IE '+(++v)+']><i></i><![endif]-->', div.getElementsByTagName('i')[0] ); return v> 4 ? v : undef; }());



Reply With Quote


Bookmarks