{"id":3027,"date":"2014-03-13T14:03:58","date_gmt":"2014-03-13T14:03:58","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/13\/problem-about-conditional-comments-collection-of-common-programming-errors\/"},"modified":"2014-03-13T14:03:58","modified_gmt":"2014-03-13T14:03:58","slug":"problem-about-conditional-comments-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/13\/problem-about-conditional-comments-collection-of-common-programming-errors\/","title":{"rendered":"problem about conditional-comments-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6017d97591b78ae31e34b6483ee77a33?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nrds<br \/>\njavascript internet-explorer browser-detection conditional-comments<br \/>\nIn order to detect IE most Javascript libaries do all sort of tricks.jQuery seem to add a temporary object into your pages&#8217;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&#8217;s true, in order to detect simply IE in Javascript we could simply add to our pages:&lt;!&#8211;[if IE]&gt;&lt;script type=&#8221;text\/javascript&#8221;&gt;window[&#8216;isIE&#8217;] = true;&lt;\/script&gt;&lt;![endif]&#8211;&gt;&lt;script type=&#8221;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/78a0a4bb106d07b6c6f33a51988155e3?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nPeter Mortensen<br \/>\njavascript html css internet-explorer-10 conditional-comments<br \/>\nHow 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&#8217;t work:&lt;!&#8211;[if IE 10]&gt; &lt;html class=&#8221;no-js ie10&#8243; lang=&#8221;en&#8221;&gt; &lt;![endif]&#8211;&gt; &lt;!&#8211;[if !IE]&gt;&lt;!&#8211;&gt; &lt;html lang=&#8221;en&#8221; class=&#8221;no-js&#8221;&gt; &lt;!&#8211;&lt;![endif]&#8211;&gt;Internet\u00a0Explorer 10 ignores the conditional comments and uses the &lt;html lang=&#8221;en&#8221; class=&#8221;no-js&#8221;&gt; instead of &lt;html class=&#8221;no-j<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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&#8217;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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3027","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3027","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3027"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3027\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3027"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3027"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3027"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}