1

Working on a legacy application, one of the UI functionality is breaking in IE11. While trying emulating different docModes, it's working fine for doc mode = 5 and UserAgent = IE 11

I Want to set this behavior through the application code, I have tried this meta tag at the top of the page-

<meta content="IE=5" http-equiv="X-UA-Compatible">

But unable to get the same behavior. Am I missing something?

As per W3 Validator,

Error: A meta element with an http-equiv attribute whose value is X-UA-Compatible must have a content attribute with the value IE=edge.

In that case what should be the value of http-equiv and content for meta tag to set that behavior?

EDIT: Adding the HTML code snippet

<!DOCTYPE HTML null null null>
<HTML>
    <head>
        <meta content="IE=5" http-equiv="X-UA-Compatible">
    </head>
5
  • Despite the error, the meta tag still can set the document mode correctly. You need to put the meta tag at the first line in <head>. The result is like this: i.stack.imgur.com/MFPyv.gif. Have you used F12 dev tools to check what document mode the page has after setting the meta tag? Do you ues Compatibility View, Enterprise Mode or something like that on the site?
    – Yu Zhou
    Jan 26, 2021 at 2:42
  • I have tried compatibility view also, no luck there. I want to set it to a particular version from the HTML meta tags which works fine for all. When I try to set it to - IE=5, it shows docMode as 9 and userAgent string to = IE 11 in emulator window in F12 developer mode and navigator.userAgent is: "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 10.0; WOW64; Trident/7.0; Touch; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; Tablet PC 2.0; Zoom 3.6.0; Zoom 3.6.0)". Jan 26, 2021 at 12:57
  • 1
    Please don't use compatibility view. Are you using HTML 5? Please use HTML 5 and the only one standard doctype declaration in HTML 5: <!DOCTYPE html>. Besides. you can also refer to this doc and check if you meet one of the conditions which makes IE use a wrong document mode.
    – Yu Zhou
    Jan 27, 2021 at 7:24
  • Thanks, @YuZhou for sharing this resource, it helped. The issue is occurring due to the compatibility view policy was forced on the organization machine for IE for intranet sites. It is working fine while I am accessing this using my personal machine. Feb 3, 2021 at 13:46
  • 1
    I'm glad that you have solved the issue. I'd like to put my comment as an answer and you can mark it as an accepted answer. It can help other community members in future in similar kind of issues. Thanks for your understanding.
    – Yu Zhou
    Feb 4, 2021 at 6:59

1 Answer 1

0

Please don't use compatibility view.

You can also refer to this doc and check if you meet one of the conditions which makes IE use a wrong document mode. For example:

The page is loaded in the Intranet zone and Internet Explorer is configured to use Compatibility View for pages loaded from the intranet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.