vamsiampolu
vamsiampolu

Reputation: 6642

When will IE8 Compatibility mode behave as IE7?

I have been ask with IE8 Quirks mode by my team for compatibility with ERP software,I have done a little reading about quirks mode,I understand that it is meant to render the page as if it were rendering in IE5 where no libraries are supported.I have however heard that IE8 Compatibility Mode in the browser can run as IE7 in some cases.

The software portal we use renders html within an iView forcing it to render in quirks mode.I have built html with the following style:

<doctype html>
<html lang="en">
   <head>
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     ....
     <body>
     ....
     <!-- load jQuery and other libraries followed by my code-->   
     </body>
</html>

Will this render as IE7,how can I find which mode it renders in and how can I force it render as IE8 or IE7?

Upvotes: 0

Views: 115

Answers (1)

Lance Leonard
Lance Leonard

Reputation: 3285

First, to answer your questions:

  1. It might render in IE7 mode, but that depends on how it's served, the security zone applied to the page, and a number of other environmental factors. Given the details in your post, I imagine it would not render in IE7 mode. (More below)

  2. If you load a page in a recent version of IE, it's likely the page would render in edge mode (aka IE11 standards mode). You could check that by hitting F12 and reading the current document mode from the F12 tools toolbar area. You can also use the window.document.documentMode property to determine the current document mode (if supported).

  3. There are several ways to force it to various document modes. In general, you have to use the x-ua-compatible header to specify the mode you want (e.g. content="IE=8"). The value you've selected tells IE to use the highest mode available. Until the release of IE11, edge mode was considered experimental; now it's preferred.

The reason why this might (or might not) render in IE7 mode depends on the way the page is being served. If it's being served in the Intranet zone and IE is set to display Intranet pages in compatibility view, then it's likely the page would render in IE7 mode. Having said that, the larger environment you described may mean the page isn't rendered in IE7 mode.

Iframes affect the equation. If your ASP page renders the Iview as an iframe, the result depends on the parent document. If the parent document is rendered in quirks mode, the child document is rendered in quirks mode. (At least that's for recent versions of IE; things change in earlier versions).

So if the code you provide is in an iframe, the result will depend on the document mode of the page containing the iframe.

Now, to control the situation, you should take some time to read up on the nitty gritty details. Next, you may wish to add some debugging code to your code to display the current document mode once the page is rendered, so that you can test the results of different experiments.

Remember that you don't necessarily need to place the x-ua-compatible within the page. (You can use group policy or have the server send headers.)

Finally, if you have Windows 8.1 Update installed, you might want to give try Enterprise IE (EMIE) a try. That forces IE11 into an IE8 mode that more accurately emulates the behavior of IE8 than the IE8 document mode does.

I know this is general, but the answers you're looking for depend greatly on the specific details you're working with. Hopefully, this will nudge you in the right direction.

Hope this helps...

-- Lance

Upvotes: 1

Related Questions