Saturday, March 21, 2009

IE8 readiness

I know people have done in depth reviews etc..., but here is a quick a low down of what you need to do as a web developer to support IE8.

I am going to assume that you have been a standards based web developer for the last couple of years and that you have not been doing too many hacks to support IE7.

1) Add the new metatag in the top of the to force IE8 to render in standards mode.

<meta http-equiv="X-UA-Compatible" content="IE=8;FF=3;OtherUA=4" />

Without this tag a little button appears next to the location bar which allows the user to view the site in IE7 compatibility mode. You probably don't want to do this because you want people to view your nice standards compliant website and also the render mode is slightly different from real IE7 in any case.

2) If you were using conditional comments to catch IE and add some extra CSS, you will probably need to update the condition from

<!--[if IE]>
<link rel="stylesheet" type="text/css" src="ie-hacks.css" />
<![endif]-->

to

<!--[if lte IE 7]>
<link rel="stylesheet" type="text/css" src="ie-hacks.css" />
<![endif]-->

3) You will probably want to put the above tags in a conditional which is controlled by a parameter so you can switch back and forth easily while testing

<% if params[:ie] != '7' %>

<meta http-equiv="X-UA-Compatible" content="IE=8;FF=3;OtherUA=4" />

<!--[if lte IE 7]>
<link rel="stylesheet" type="text/css" src="ie-hacks.css" />
<![endif]-->

<% end %>

And then access the IE7 mode in the following manner

http://yourserver.com/login?ie=7

4) There is currently a known bug with the scrollHeight and scrollTop properties (this broke the Yahoo Rich Text Editor I had embedded in my site http://www.quirksmode.org/blog/archives/2008/03/ie8_beta_1_firs.html). It does not appear to be fixed yet in the release version.

I am sure there is plenty more, but this is what I have discovered so far.