Doctype over Meta X-UA-Compatibility - html

If I use <!doctype html>, do I have to use <meta http-equiv="X-UA-Compatible" content="IE=edge"> to prevent Internet Explorer's compatability message?
Thanks guys!

Using <meta http-equiv="X-UA-Compatible" content="IE=edge"> will override such settings as "Display intranet sites in Compatibility View" (which is enabled by default). I've found using the meta tag is helpful when working on new pages which share a server with old (IE7 and older) pages, but I'm not sure if it's the preferred technique.

Related

How to use http-equiv and name attribute at the same time?

I was researching about meta tags in HTML and I ended up on a website that suggested that I don't set the name and htt-equiv attribute at the same time. I read somewhere that if I need to support IE8 OR IE9 then it's recommended to use the http-equiv attribute with X-UA Compatible value. My website needs to be supported by older versions of IE so i use the following line of code:
<meta http-equiv="X-UA-Compatible" content="IE=edge">
But at the same time, i also want to provide extra information such as description of my webpage and also specify keywords. Those are set by using the name attributes. Like this:
<meta name="description" content="">
<meta name="author" content="">
<meta name="keywords" content="">
But according to several webpages, I cannot use the http-equiv and name attributes at the same time. So how do I ensure compatibility with older versions of IE and extra information about the webpage at the same time?
I'm quite confused, please enlighten me.

Make "IE9 Compatibility View" mode default when IE9 renders a site

I have developed a web site on Google App Engine using JSP and JQuery 1.11.2. The following tag is added to the Head section on every jsp.
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
The client has to be using IE9 to view this site. Also, the javascript code only works with "IE9 Compatibility View".
The issue is every time the user opens the home page IE9 renders it in "Internet Explorer 9" mode instead of ""IE9 Compatibility View"".
How can I set up the meta tag in head to force IE9 to use "IE9 Compatibility View" as Browser Mode and keep "IE9 Standards" as Document Mode?
For force IE9 to use "IE9 Compatibility View", like this:
<meta http-equiv="X-UA-Compatible" content="IE=9">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
or use X-UA-Compatible in the HTTP header.
Use this as a first meta tag in page,
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

How to get the latest IE Compatibility mode, up to IE9?

Right now I am using the following on a Master Template in SharePoint 2010...
<meta http-equiv="X-UA-Compatible" content="IE=edge">
But how do I get edge, but only up to IE9? I don't want IE to try to render a page under IE10 standards in an IE10 browser. I want it to use IE9 standards, which works a lot better....
thanks for any advice.
I think you want to change that to
<meta http-equiv="x-ua-compatible" content="IE=EmulateIE9" >
See http://msdn.microsoft.com/en-us/library/jj676915(v=vs.85).aspx for more details.

IE8 will not display frames when http-equiv="X-UA-Compatible" is used

I have the following html code that works without the http-equiv="X-UA-Compatible" in IE8 but fails when it has it. I think the order is correct (http://blogs.msdn.com/b/ieinternals/archive/2011/07/18/optimal-html-head-ordering-to-avoid-parser-restarts-redownloads-and-improve-performance.aspx), and the code is valid so I don't see the reason why it would do this.
Please, any explanation?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8, IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<base href="file:///D:/LocalPath/ToFrameElements/">
<title>IE8 stuff</title>
</head>
Your X-UA-Compatible http-equiv string is invalid.
It has 2 values:
IE=8 ( IE 8 standards rendering mode )
IE=edge ( latest engine )
However, the syntax is incorrect. The correct syntax is:
<meta http-equiv="X-UA-Compatible" content="IE=8; IE=edge" />
When multiple values are specified, highest value will be used. That is,
In IE9 , the page will be rendered in IE 9 standards rendering mode.
In IE8 , the page will be rendered in IE 8 standards rendering mode.
Solution: Fix the syntax and retry.
Reference:
https://developer.mozilla.org/en-US/docs/Persona/Browser_compatibility
Define Document Compatibility
Understanding Compatibility Modes in IE8
Sidenote: IE supports this meta tag starting from IE 8.
The base element is defined so that its value must be an absolute URL. Besides, any effect of a file: URL is by definition system-dependent. So you should organize your local files and references to them so that a base tag is not needed.
The frames wouldn't appear because of the standard document mode that the
<meta http-equiv="X-UA-Compatible" content="IE=8, IE=edge" />
or not relaying on the browser's error tolerance, the syntactically correct way
<meta http-equiv="X-UA-Compatible" content="IE=8; IE=edge" />
implies.
This is because in the standard document rendering mode IE does not allow the use of base href with links to the filesystem for security's sake. To have the base href working it can only be achieved by removing the the meta http-equiv="X-UA-Compatible" so that page will run in quirks rendering mode.

How do I know if the content of my site is compatible with the meta tag X-UA-Compatible/IE=edge?

How can I tell if I should include this meta tag in my site?
<meta http-equiv="X-UA-Compatible" content="IE=edge">
By testing it in various versions of IE (and, as a rule of thumb, if there are problems, fix the problems rather then telling IE to emulate an older version of itself).