aFarkas / html5shiv

This script is the defacto way to enable use of HTML5 sectioning elements in legacy Internet Explorer.
http://paulirish.com/2011/the-history-of-the-html5-shiv/
9.88k stars 2.56k forks source link

Does not work #200

Closed jkantner closed 3 years ago

jkantner commented 8 years ago

The script never works. In IE 11, I changed the document mode and user agent string to 8 and Internet Explorer 8 respectively, and my page still looked as if the script were not included at all. For example, I gave the <article> tag a width of 650px, and it still looks like 100% in IE8. I even refreshed the page, tried putting the script in both the <head> and before </body>, and still nothing happened. I did not modify the script in any way, and I only pasted the code as is with path/to/ being an actual path.

`<!--[if lt IE 9]>

<![endif]-->`

aFarkas commented 8 years ago

Maybe use a real IE8? And if you don't have one. Don't support IE8.

jkantner commented 8 years ago

I have tested an IE8-only script such as <!--[if lt IE 9]> <script>console.log('IE8 detected');</script> <![endif]--> in IE11 with IE8 standards, and it worked. So, there must be a problem with html5shiv.

PascalReintjens commented 8 years ago

On my page, the shiv works totally fine in IE8. I have experienced in the past, that it makes no sense to let the newer IE versions emulate the old ones. In reality, the emulated behavior still differs significantly from the real behavior, so even if some tools work great or have some problems in the emulation, this means literally nothing. That's why microsoft even officially publishes free virtual machines for IE testing purposes, you can find them here: https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/windows/

If you really want to test for the old IE versions, I'd recommend you download some of these VMs. I'm working with Virtual Box, which runs great and is easy to use, you just should make a snapshot before the first start of your VM, so that you can roll them back regularly.

In case that this is too much work and you really just want to check whether this script works (which I do not recommend in case you really want to support old IEs), please provide a testcase ;)