internet explorer - What does <meta http-equiv="X-UA-Compatible" content="IE=edge"> do? -


what's difference if 1 web page starts with

<!doctype html>  <html>    <head>      <meta http-equiv="x-ua-compatible" content="ie=edge">  

and if page starts with

<!doctype html>  <html>    <head>       <!-- without x-ua-compatible meta --> 

if there no difference, suppose can ignore x-ua-compatible meta header, since want rendered in standard mode in ie versions.

october 2015 update

this answer posted several years ago , question should should consider using x-ua-compatible tag on site changes microsoft has made browsers (more on below).

depending upon microsoft browsers support may not need continue using x-ua-compatible tag. if need support ie 9 or ie 8, recommend using tag. if support latest browsers (ie 11 and/or edge) consider dropping tag altogether. additional info below:


the x-ua-compatible meta tag allows web authors choose version of internet explorer page should rendered as. ie11 has made changes these modes; see ie11 note below. microsoft edge, browser released after ie11, honor x-ua-compatible meta tag in circumstances. see microsoft edge note below.

according microsoft, when using x-ua-compatible tag, should high possible in document head:

if using x-ua-compatible meta tag want place close top of page's head possible. internet explorer begins interpreting markup using latest version. when internet explorer encounters x-ua-compatible meta tag starts on using designated version's engine. performance hit because browser must stop , restart analyzing content.

here options:

  • "ie=edge"
  • "ie=11"
  • "ie=emulateie11"
  • "ie=10"
  • "ie=emulateie10"
  • "ie=9"
  • "ie=emulateie9
  • "ie=8"
  • "ie=emulateie8"
  • "ie=7"
  • "ie=emulateie7"
  • "ie=5"

to attempt understand each means, here definitions provided microsoft:

internet explorer supports number of document compatibility modes enable different features , can affect way content displayed:

  • edge mode tells internet explorer display content in highest mode available. internet explorer 9, equivalent ie9 mode. if future release of internet explorer supported higher compatibility mode, pages set edge mode appear in highest mode supported version. same pages still appear in ie9 mode when viewed internet explorer 9. internet explorer supports number of document compatibility modes enable different features , can affect way content displayed:

  • ie11 mode provides highest support available established , emerging industry standards, including html5, css3 , others.

  • ie10 mode provides highest support available established , emerging industry standards, including html5, css3 , others.

  • ie9 mode provides highest support available established , emerging industry standards, including html5 (working draft), w3c cascading style sheets level 3 specification (working draft), scalable vector graphics (svg) 1.0 specification, , others. [editor note: ie 9 does not support css3 animations].

  • ie8 mode supports many established standards, including w3c cascading style sheets level 2.1 specification , w3c selectors api; provides limited support w3c cascading style sheets level 3 specification (working draft) , other emerging standards.

  • ie7 mode renders content if displayed in standards mode internet explorer 7, whether or not page contains directive.

  • emulate ie9 mode tells internet explorer use directive determine how render content. standards mode directives displayed in ie9 mode , quirks mode directives displayed in ie5 mode. unlike ie9 mode, emulate ie9 mode respects directive.

  • emulate ie8 mode tells internet explorer use directive determine how render content. standards mode directives displayed in ie8 mode , quirks mode directives displayed in ie5 mode. unlike ie8 mode, emulate ie8 mode respects directive.

  • emulate ie7 mode tells internet explorer use directive determine how render content. standards mode directives displayed in internet explorer 7 standards mode , quirks mode directives displayed in ie5 mode. unlike ie7 mode, emulate ie7 mode respects directive. many web sites, preferred compatibility mode.

  • ie5 mode renders content if displayed in quirks mode internet explorer 7, similar way content displayed in microsoft internet explorer 5.

ie 10 note: of internet explorer 10, quirks mode behaves differently did in earlier versions of browser. in windows internet explorer 9 , earlier versions, quirks mode restricted webpage features supported microsoft internet explorer 5.5. in internet explorer 10, quirks mode conforms differences specified in html5 specification.

personally, choose http-equiv="x-ua-compatible" content="ie=edge" meta tag, older versions have plenty of bugs, , not want ie decide go "compatibility mode" , show site ie7 vs ie8 or 9. prefer latest version of ie.

ie 11

from microsoft:

starting ie11, edge mode preferred document mode; represents highest support modern standards available browser.

use html5 document type declaration enable edge mode:

<!doctype html>

edge mode introduced in internet explorer 8 , has been available in each subsequent release. note features supported edge mode limited supported specific version of browser rendering content.

starting ie11, document modes deprecated , should no longer used, except on temporary basis. make sure update sites rely on legacy features , document modes reflect modern standards.

if must target specific document mode site functions while rework support modern standards , features, aware you're using transitional feature, 1 may not available in future versions.

if use x-ua-compatible header target legacy document mode, it's possible site won't reflect best experience available ie11.

microsoft edge (replacement internet explorer comes bundled windows 10)

information on x-ua-compatible meta tag "edge" version of ie. from microsoft:

introducing “living” edge document mode

as announced in august 2013, deprecating document modes of ie11. our latest platform updates, need legacy document modes limited enterprise legacy web apps. new architectural changes, these legacy document modes isolated changes in “living” edge mode, guarantee higher level of compatibility customers depend on modes , move faster on improvements in edge. next major version of ie still honor document modes served intranet sites, sites on compatibility view list, , when used enterprise mode only.

public internet sites rendered new edge mode platform (ignoring x-ua-compatible). our goal edge "living" document mode here out , no further document modes introduced going forward.

with changes in microsoft edge no longer support document modes in cases, microsoft has tool scan site check , see if has code not compatible edge.

chrome=1 info ie

there chrome=1 can use or use 1 of above options, ex: <meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1"> chrome=1 google's chrome frame defined as:

google chrome frame open source browser plug-in. users have plug-in installed have access google chrome's open web technologies , speedy javascript engine when open pages in browser.

google chrome frame seamlessly enhances browsing experience in internet explorer. displays google chrome frame enabled sites using google chrome’s rendering technology, giving access latest html5 features google chrome’s performance , security features without in way interrupting usual browser usage.

when google chrome frame installed, web gets better without having think it.

but plug-in work must use chrome=1 in x-ua-compatible meta tag.

more info on chrome frame can found here.

note: google chrome frame works ie6 through ie9, , retired on february 25, 2014. more info can found here. thank @mck link.

validation:

html5:

the page validate using w3 validator when using <meta http-equiv="x-ua-compatible" content="ie=edge">. other values throw error: a meta element http-equiv attribute value x-ua-compatible must have content attribute value ie=edge. in other words, if have ie=edge,chrome=1 not validate. ignore error modern browsers ignore line of code.

if must have valid code consider doing on server level setting http header. note, microsoft says, if both of these instructions sent (meta , http), developer's preference (meta element) takes precedence on web server setting (http header). see olibre's answer or bitinn's answer more details on how set http header.

xhtml

there isn't issue validation when using <meta http-equiv="x-ua-compatible" content="ie=edge" /> long tag closed, ie: /> vs >


for more information on x-ua-compatible see microsoft's website defining document compatibility.

for more information on ie supports see website caniuse.com


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -