My IE10 update rolled through a few days ago so I've been in a similar boat - nothing too twitchy, but a few conditional IE stylesheet tweaks that obviously now don't render. Easily fixed with some media queries plonked right back into my main stylesheets though... Code: @media screen and (min-width:0\0) { /* IE9 and IE10 */ body { background:red; } }
@media screen and (min-width:0\0) { /* IE9 and IE10 */ body { background:red; } }
Yes, you're right about the javascript. Thanks. As for the IE conditional comments, the problem I encountered was that with IE10, lines like Code: <!--[if IE]> <script> alert('hello') </script> <![endif]--> and Code: <!-- <script> alert('hello') </script> --> are treated in exactly the same way (same result: no alert) unless we add a meta tag like: Code: <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9"> which we don't want in many cases.
<!--[if IE]> <script> alert('hello') </script> <![endif]-->
<!-- <script> alert('hello') </script> -->
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9">
There's a slightly more efficient (since IE 6 all IE versions are whole numbers, so we need not worry about the \.\d+ part any longer) and more standard (using RegExp.$# has been deprecated) way to test IE version in javascript: Code: var ievesion = /MSIE (\d+)/.exec(navigator.userAgent); ieversion = ieversion? ieversion[1] : false; However, since IE 10 is for the most part as compliant as any other modern browser, IE conditional comments can still be used in most cases. IE 10 will take the same path as - say, Chrome or the Fox.
var ievesion = /MSIE (\d+)/.exec(navigator.userAgent); ieversion = ieversion? ieversion[1] : false;