1
我們正在爲我們的應用程序使用IE邊緣,但我們希望在IE 10中打開一個特定的內容頁面。帶有<meta http-equiv =「X-UA兼容」的內容頁面content =「IE = 10」/>
我們不能添加
<meta http-equiv="X-UA-Compatible" content="IE=10" />
到母版頁,因爲它會被反映在所有其他網頁。
如何實現
<meta http-equiv="X-UA-Compatible" content="IE=10" />
特定內容。
我在內容頁面中嘗試了以下代碼,但沒有更改。
<script type="text/javascript">
function AddCompatible() {
var m = document.createElement("meta");
m.setAttribute("http-equiv", "X-UA-Compatible");
m.setAttribute("content", "IE=10");
document.getElementsByTagName("head")[0].appendChild(m);
}
_spBodyOnLoadFunctionNames.push("AddCompatible")
爲什麼你不能將它添加到內容頁面呢? –
當我們將它添加到內容頁面時,javascript和 Geeth
你能否確認JavaScript實際上正在更新內容頁面?由於它將meta添加到文檔中,我懷疑它實際上是插入到母版頁中的。一旦執行完畢,您可以通過在IE的開發人員工具面板中使用DOM Explorer來確認元標記的位置。 –