js テスト ドライバーの Eclipse プラグインを使用して、IE でテストを実行したいと考えています。IE9 をインストールしていますが、IE8 ドキュメント モードでテストを実行したいと考えています。これは、開発中のアプリが実行されているためです。
IE9 がインストールされている場合、IE8 ドキュメント モードで js-test-driver プラグインを起動する方法はありますか? MS Developer Tools でモードを切り替えることは可能ですが、それは私が探しているものではありません。
jsTestDriver.conf ファイルに次のようなスクリプトを追加して、起動時にメタ タグを追加するスクリプトを読み込もうとしました。
...
load:
- js/bootstrap-IE8.js
...
およびブートストラップ ファイル内のコード:
(function(){
var meta = document.createElement('meta');
meta.setAttribute('http-equiv','X-UA-Compatible');
meta.setAttribute('content','IE=8');
var meta2 = document.createElement('meta');
meta2.setAttribute('Content-Type','X-UA-Compatible');
meta2.setAttribute('content','text/html; charset=utf-8');
var tophead = top.document.getElementsByTagName('head')[0];
var toptitle = tophead.firstChild;
tophead.insertBefore(meta, toptitle);
tophead.insertBefore(meta2, toptitle);
})();