http-equivの「X-UA-Compatible」属性の理解



Understanding Ofx Ua Compatibleattribute Http Equiv



X-UA-CompatibleはIE8以降の新しい設定であり、IE8より前のブラウザーでは認識されません。メタでX-UA-Compatibleの値を設定することにより、Webページの互換モード設定を指定できます。


IE8が最初にリリースされたとき、多くのWebページは、リファクタリングの問題のために高レベルのブラウザーに適応できませんでした。モデルの古いバージョンとの互換性を考慮して、X-UA-Compatibleタグを使用して、IE8に強制的に下位バージョンを使用してレンダリングしました。
例:content =” IE = 7”ページに説明が含まれているかどうかに関係なく、Windows Internet Explorer7の標準モードを使用してIE7を使用してIE8をレンダリングしているようです。

Webページで指定されたモードは、サーバーで指定されたモードよりも優先されます(HTTPヘッダーを介して)。互換モード設定の優先順位:



<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>

メタタグ> httpヘッダー

一般的な例:



<script src='http://ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js'>script><script>CFInstall.check()script>

二、content =“ IE = Edge、chrome = 1”



メタ情報にはしばしばそのような文があります:

meta tag > http header

上記の2つを考慮した、最良の互換モードソリューション:
ここでのchrome = 1は、IEテクノロジーがChromeブラウザーをシミュレートするように拡張されていることを意味するのではなく、Googleが開発したGoogle Chromeフレーム(Google Embedded Browser Frame GCF)に関連しています。このプラグインを使用すると、ユーザーのIEブラウザーを変更せずに表示できますが、ユーザーは実際にWebを閲覧するときにChromeカーネルを使用し、WindowsXP以降のシステムのIE6 / 7/8をサポートします。




IEユーザーにGoogleフレームのインストールを促す
Googleは、GoogleFrameプラグインのインストールの検出を公式に提供します。ここでは、メソッドを直接呼び出すことができます。 IEがGoogleフレームをインストールしていないことが検出されると、インストールを求めるダイアログボックスが表示されます。
http-equiv='X-UA-Compatible' content='IE=7'> #The above code tells the IE browser that IE8/9 will use the IE7 engine to render the page regardless of whether the document standard is declared with DTD.  http-equiv='X-UA-Compatible' content='IE=8'> #The above code tells the IE browser that IE8/9 will use the IE8 engine to render the page.  http-equiv='X-UA-Compatible' content='IE=edge'> #The above code tells the IE browser that IE8/9 and later versions will render the page with the highest version of IE.  http-equiv='X-UA-Compatible' content='IE=7,IE=9'> http-equiv='X-UA-Compatible' content='IE=7,9'> http-equiv='X-UA-Compatible' content='IE=Edge,chrome=1'> #The above code IE=edge tells IE to use the latest engine to render the webpage, chrome=1 can activate Chrome Frame.