problem about conditional-comments-Collection of common programming errors
rds
javascript internet-explorer browser-detection conditional-comments
In order to detect IE most Javascript libaries do all sort of tricks.jQuery seem to add a temporary object into your pages’s DOM to detect some features, YUI2 does regex on the user agent in its YAHOO.env.ua = function() (file yahoo.js)After reading this answer it came in my mind that it’s true, in order to detect simply IE in Javascript we could simply add to our pages:<!–[if IE]><script type=”text/javascript”>window[‘isIE’] = true;</script><![endif]–><script type=”
Peter Mortensen
javascript html css internet-explorer-10 conditional-comments
How do I target only Internet Explorer 10 for certain situations like Internet Explorer-specific CSS or Internet Explorer-specific JavaScript code?I tried this, but it doesn’t work:<!–[if IE 10]> <html class=”no-js ie10″ lang=”en”> <![endif]–> <!–[if !IE]><!–> <html lang=”en” class=”no-js”> <!–<![endif]–>Internet Explorer 10 ignores the conditional comments and uses the <html lang=”en” class=”no-js”> instead of <html class=”no-j
Web site is in building