Question

Currently I'm having some issues with my magento installation in IE9 and IE10. IE8 works perfect so I thought about adding a meta-tag:

<meta http-equiv="X-UA-Compatible" content="IE=8" />

After doing this IE still renders the page as IE9 or IE10.

I think this is cause of another meta tag which is still in the head (only in IE).

<meta http-equiv="X-UA-Compatible" content="IE=edge">

After a search in Google and the Magento code and still didn't find a solution, so I thought I ask you guys.

Thanks!

Était-ce utile?

La solution

Currently I'm having some issues with my magento installation in IE9 and IE10. IE8 works perfect so I thought about adding a meta-tag:

<meta http-equiv="X-UA-Compatible" content="IE=8" />

First things first: this is a bad solution. In general, IE versions are better and better at being standards-compliant as the version number goes up. If your code works better on an old IE version than the new ones, it probably means that you have bugs in your code that need to be fixed.

You would be better off trying to find those bugs than trying to use compatibility mode to avoid doing the work. Compat mode isn't really all that good, so you may be causing other problems by using it, and anyway you will have to do the work to fix your code in the end, so you may as well do it now.

After doing this IE still renders the page as IE9 or IE10.

I think this is cause of another meta tag which is still in the head (only in IE).

<meta http-equiv="X-UA-Compatible" content="IE=edge">

Yes, if you have both of these tags in your code, it will confuse IE. IE=edge is telling IE to use it's best available mode (so, IE9 mode in IE9 and IE10 mode in IE10, etc) and IE=8 is telling it to use IE8-compatiblity mode.

The two are direct opposites of each other so it's no wonder that causes the browser to get confused. You should only ever have one or the other of these two lines in your code. Never both.

But as I said above, using IE8-compat mode is really not a good thing to do; it has some nasty glitches of its own.

Best practice is always to specify the edge mode tag, and nothing else.

My advice, therefore, is to drop the IE8-mode tag that you're trying to use, and instead fix your code to work properly with all versions of IE.

You haven't said anything about what your issues are with IE9/10, but my guess is that if you ask about them, they'll turn out to be fairly simple problems to solve.

Hope that helps.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top