internet explorer 10 - JavaScript browser detection in IE10 -
i'm updating website design because doesn't work in ie10.
i using combination of conditional comments , javascript handle ie version detection, since ie10 has dropped former , haven't found reason ignoring latter, i'm seeking here. i've been reading thread:
detect ie version (prior v9) in javascript
but knowledge of javascript isn't far off zilch, i'm not sure whether should looking modify code or scrap , adopt , change code mentioned in url (and if so, how should that).
the code i'm using:
<link rel="stylesheet" type="text/css" href="barebones.css"> <!--[if lte ie 8]> <link rel="stylesheet" type="text/css" href="ie.css"> <![endif]--> <!--[if gt ie 8]> <link rel="stylesheet" type="text/css" href="default.css"> <![endif]--> <script type="text/javascript"> //<![cdata[ var appname = window.navigator.appname; if (appname !== "microsoft internet explorer") document.write("<link rel=\"stylesheet\" type=\"text\/css\" href=\"default.css\" \/>");//]]> </script>
if helps can post site url didn't want people think i'm trying more site traffic or something.
i know code i'm using can refined bit rather things working before having spring clean.
ie10 on more 1 machine seems ignore javascript , don't know why. ie9 handles fine.
any assistance appreciated.
it's best when dealing these kind of issues avoid "broswer detection" , go "feature detection"
a library http://modernizr.com/ test specific features browser's compatible rather hacking around different versions of browsers.
that being said, ie10 tends standards compliant browser. can visit http://caniuse.com/ , find charts of various javascript , css features , one's supported in different browsers.
you'll find ie10 adheres great deal of these standards.
Comments
Post a Comment