HTML1115: X-UA-Compatible META tag ('IE=9, IE=8, chrome=1') ignored because document mode is already finalized
Asked Answered
B

1

11

I got such warning:

HTML1115: X-UA-Compatible META tag ('IE=9, IE=8, chrome=1') ignored because document mode is already finalized.

when I try to open my website at IE9. I have addthis script:

<script type="text/javascript" src="https://s7.addthis.com/js/250/addthis_widget.js#async=1"></script>

which adds google+ button

<a class="addthis_button_google_plusone" g:plusone:size="medium"></a>

When I comment this line - warning disappear. How I can fix this?

Bucci answered 7/6, 2012 at 13:32 Comment(0)
M
17

The x-ua-compatible meta tag must come before all other elements that aren't meta or title.

Otherwise, I think the document mode is already decided and IE will ignore later attempts to cue it as to which doc mode to use.

Marker answered 10/7, 2012 at 20:58 Comment(5)
Tried this, without success :(Bucci
Ah, according to the article here: evolpin.wordpress.com/2011/02/25/… It must be the very first even among meta tags. unfortunately I favor charset=utf-8 over this browser specific tag, since the charset needs to be really early.Crossstitch
Paraphrasing Timo Lehto: As to whether the declaration needs to be the very first element in the header or not. It doesn't need to be the first, so long as it is only preceded by other meta tags or title tag in the header. Here's some quotes from MSDN: "The X-UA-Compatible header isn't case sensitive; however, it must appear in the header of the webpage (the HEAD section) before all other elements except for the title element and other meta elements."Marker
paraphrase continued: If you're having trouble making bowsers realise this be sure to reset browsers/servers cache. It may also be an option for you to make your web server set the compatibility mode on the http headers: "A web server can also be configured to specify the X-UA-Compatible header. If a web server specifies the header and the header also appears within the content of a webpage, the header in the webpage takes precedence over the one specified by the server."Marker
I think I've seen things where an extra space or newline before either the doctype or the html tag messes with this kind of thing. For those who had this not work for them you could check what was sent over the wire and make sure it looks like you aren't having content sent that trips the doc mode decision.Marker

© 2022 - 2024 — McMap. All rights reserved.