home | downloads | recipes | blogs | staff | about us | *

The Art of Lightning
Get ready for IE 8James Zimmerman5/29/2008

What is IE "Standards Mode"?

"Standards Mode" encompasses a number of changes in IE 8 intended to make it compliant with W3C (World Wide Web Consortium) standards.

What is driving this change?

Microsoft recent published a set of Interoperability Principles that are intended to increase the openness of our products and drive greater interoperability. Please read Dean Hachamovitch's blog entry for more information on how this affects development of Internet Explorer.

IE 8 Default Layout Mode

IE 8 will ship with three layout modes – Quirks, IE 7 Standards, and IE 8 Standards. The IE 8 Standards mode will be the default layout mode, because it is the most standards compliant of the three. For more information on layout modes, please read Scott Dickens' blog entry.

How will this impact my apps?

When IE 8 ships, the default layout rendering mode (IE 8 Standards) will not be the same mode that your applications have been developed under, and this will likely cause issues with UI layout and functionality in your applications.

When can I expect this change?

IE HTML/DOM (Document Object Model) Standards have already changed with the Beta 1 (Developer) release of IE 8. For more background information and specific details on changes, please read Travis Leithead's blog entry.

How do I keep my apps working?

Short term, you can force your applications to render in IE 7 Standards Mode by making the following modifications:

On a per site basis, add the HTTP header: X-UA-Compatible: IE=EmulateIE7, or..

On a per page basis (if required), add <META http-equiv=’\”X-UA-Compatible” content=”IE=EmulateIE7”/> inside the HTML header () element.

Long term, you should be updating and developing applications which support the announced interoperability principles by complying with the latest IE Standards Mode.

Additional IE 8 Changes/Known Issues

The changes listed below could impact the functionality of your web-based client applications. Known changes and potential issues at this time include the following:

HTTP Header The HTTP Header will now show MSIE 8.0 instead of MSIE 7.0. This mainly affects server side logic.

Browser Query String The windows.navigator.userAgent string will now return MSIE 8.0 instead of MSIE 7.0, which may result in undesired page functionality if code has been written expressly to handle IE 7.0 only (==) instead of IE 7.0 or greater (>=).

ASP.Net sample code

System.Web.HttpBrowserCapabilities browser = Request.Browser;
Bool isIE8 = (browser.Browser == “IE” && (browser.MajorVersion >= 8));

System.Web.HttpBrowserCapabilities browser = Request.Browser;
Bool isIE7 = (browser.Browser == “IE” && ((browser.MajorVersion >= 7) && 
(browser.MajorVersion <= 8)));

Clientside Javscript sample code


function isExplorer8orLater()
{
     var f_result = new Boolean(false);
     var ua = navigator.userAgent;
     var re = new RegExp(“MSIE ([0-9\.].*?);”);
     if (re.exec(ua) != null)
     {
              if (parseFloat (RegExp.$1) >= 8.0)
                        f_result = true;
     }
     return f_result;
}

function isExplorer7()
{
     var f_result = new Boolean(false);
     var ua = navigator.userAgent;
     var re = new RegExp(“MSIE ([0-9\.].*?);”);
     if (re.exec(ua) != null)
     {
              if ((parseFloat (RegExp.$1) >= 7.0) && (parseFloat (RegExp.$1) <= 8.0))
                        f_result = true;
     }
     return f_result;
}

Conditional Comments

<!--[IF IE 7]> … IE 7.0 specific CSS … <![endif]-->

The conditional comment above will fail with IE 8.0, and the CSS will not be rendered, resulting in the page not appearing as it should. <!--[if gte IE 7]> (greater than or equal to IE 7.0) should be used instead.

For more examples, please refer to this MSDN page on conditional comment usage.

HTML/CSS

If you haven’t added new IE 8.0 HTML or CSS features, then all pages/apps should behave the same as they did with IE 7.0.

 

Look for more blogs |

(c) 2001-2009 Stuart Williams, E-Mail Stuart Williams