0

My computer is running Windows 8.1 Pro with IE : 11.0.9600

<!--[if IE 8]> 
<script type="text/javascript" src="libs/ie/IE8.js">          </script>
<![endif]-->
<!--[if IE 9]> 
    <script type="text/javascript" src="libs/ie/IE9.js"></script>
<![endif]-->
<!--[if lt IE 9]>
    <script type="text/javascript" src="libs/html5shiv/html5shiv.js"></script>
    <script type="text/javascript" src="libs/respond/respond.min.js"></script>
<![endif]-->

When I browse in IE using the Development Tools and switch the mode to IE 8, nothing changes!

How do I fix it? Thanks in advance.

Sumner Evans
  • 8,951
  • 5
  • 30
  • 47
Peter Jack
  • 847
  • 5
  • 14
  • 29
  • 1
    possible duplicate of [Why doesn't IE11 honour conditional comments even when emulating IE8 document mode?](http://stackoverflow.com/questions/19446584/why-doesnt-ie11-honour-conditional-comments-even-when-emulating-ie8-document-mo) – Justin Niessner Mar 28 '14 at 21:12

2 Answers2

1

IE has terrible backwards preservation.

If you want to test in IE8 the only way to get reliable results is to run IE8.

Sorry.

Josh
  • 140
  • 7
0

Because browser sniffing causes many problems IE removed conditional comment support like this. Instead you should do feature detection. For example

if("localStorage" in window){}

Feature detection will always tell you if something is supported and you can adjust as needed from there. Browser Sniffing makes far too many assumptions, many of which of incorrect. It is also not future-friendly, where feature detection is a feature friendly technique.

Chris Love
  • 3,740
  • 1
  • 19
  • 16