开发者

IE8 compatibility mode...help?

开发者 https://www.devze.com 2023-01-07 07:30 出处:网络
I\'m trying to setup compatibility mode in one of our开发者_开发技巧 web products however I cannot get compatiblity mode to work via a particular server.

I'm trying to setup compatibility mode in one of our开发者_开发技巧 web products however I cannot get compatiblity mode to work via a particular server.

To recount what I've done so far:

  1. I've set the the HTTP header X-UA-Compatible in IIS to IE=7

  2. I've set also addded the meta element as the first element in the head element to the master page:

Using fiddler I've checked the HTTP traffic and I can see the header value and the meta element. Using the same browser (different tab) when I point to our staging server the document renders as IE7 brower mode and IE7 document mode. Which is great. Unfortunately when I point to the live server which is configured in the same way as the staging server the document renders as IE8 browser mode and IE7 document mode.

As a result when I check the dev tools the CSS which is being applied to the html element is

" ie ie8 CSS1Compat Win32"

vs

" ie ie7 CSS1Compat Win32"

Has anyone got any suggestions what I might have missed?

Note there is a blank line before DOCTYPE instruction (which is meaningful).

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:b="http://www.backbase.com/2006/btl"
    xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:e="http://www.backbase.com/2006/xel"
    xmlns:c="http://www.backbase.com/2006/command" xmlns:d="http://www.backbase.com/2006/tdl"
    xmlns:x="http://woodmac.com/x">
    <head><meta http-equiv="X-UA-Compatible" content="IE=7" /><meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /><meta http-equiv="expires" content="-1" /><meta name="robots" content="index,follow" />
        <script type="text/javascript" src="Backbase/engine/boot.js"></script>

    <link href="App_Themes/MANDA/print_style.css" type="text/css" rel="stylesheet" /><link href="App_Themes/MANDA/screen_style.css" type="text/css" rel="stylesheet" /></head>
    <body>

Thanks,

Philip


Take a look at this site and see if you missed anything. It may be related to the doctype, but it looks like the meta tags should override that.


What url are you using to access each server? IE8 has an option which is enabled by default which will force "intranet", or single-name, domains to render in compatibility mode regardless of your XUA and other header settings (Tools > Compatibility View Settings > Display intranet sites in compatibility view).

If this setting is enabled and you are accessing one or the other of your staging and prod sites with something like http://servername, then this may be causing them to render differently regardless of your setting.

Recently I was faced with this issue and ended up requiring all servers to be accessed with a domain extension (e.g. http://servername.company.com), and set the XUA header to IE7. Now everything renders in IE7 mode regardless of the server its running on.

0

精彩评论

暂无评论...
验证码 换一张
取 消