The other day at work I was working on finishing up a Web Forms page by working on some differences and weirdness I was experiencing when viewing the page in an IE9 browser. While trying to do some debugging I opened the Developer Tools console in IE. After a little while I realized that the Browser Mode was IE9 Compatability Mode and the Document Mode was set to Quirks. Neither one of these settings were what I expected/wanted. After a bit of research I found the reasoning for both, and actual ways that certain content or structure of content can affect both of these IE modes.

The Document Mode being set to Quirks mode was the most concerning to me. I quickly found out from research that Quirks mode is basically the same as rendering the site in IE5. No wonder there were a lot of weird things going on when I was viewing the site in IE. I found out that this can be caused by having other "content" or tags in your html file before the <!doctype> tag. So I viewed the source of my page as rendered in IE and sure enough there were some comments listed before the <!doctype> tag. I located the source of the comments (our site.master page) and moved them below the <!doctype> tag. And right away the document mode was corrected to be IE9 as expected.

As for the Browser Mode being IE Compatability Mode, I found out that just has to do with the web site being viewed as an intranet site since its domain was localhost. Apparently IE makes the Browser Mode "Compatability" for any intranet sites by default. In IE9 there is a setting to change this, but as far as I can tell, as long as you understand that setting it does not make any real difference.

During my research I also found that there is a "meta" tag that can be added to the "head" section of web pages that generally can dictate to IE what browser/document modes to use to view the page. The meta tag is:

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

The "content" attribute value can be "IE=X" where can can be 5, 7, 8, EmulateIE7, EmulateIE8, Edge. If you really want to know how each of these affect the latest versions of IE I invite you do look up "X-UA-Compatible" via Google. But what I have learned is most people just recommend using "IE=Edge" to make sure the latest IE technology is always being targeted.

Gravatar

Comments

re: What I learned about IE Compatibility and Document Modes

Thursday, March 9, 2017 1:46:13 AM

Excellent read, Positive site, where did u come up with the information on this posting? I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work.You can browse [url=http://rospher.com/]custom essay writing service[/url] for new writing ideas.

You must sign in to this site to post comments.
Already Registered?
Login
Not Yet Registered?
Register

Support and Encourage Me

 


 

Proud member of the mojoPortal team

 

Security Plus Logo


 

I use and recommend SmarterASP.NET for my ASP.NET websites

With a 60 day free trial and then a 60 day money back guarantee what do you have to lose? Give them a try!