当前位置: 动力学知识库 > 问答 > 编程问答 >

Change IE document mode via Javascript

问题描述:

Is it possible to change the document mode via js? The js is run as code from a bookmarklet.

I AM able to change the content mode in the meta tag, but this doesn't actually make the page render any differently. I need to be able to run js code that doesn't work in IE8 (i.e. getComputedStyle).

var metas = document.getElementsByTagName("meta");

for (var i=0; i<metas.length;i++) {

if (metas[i].getAttribute("content") ) {

if(metas[i].getAttribute("content")=="IE=8"){

metas[i].setAttribute("content","IE=9"); // also tried IE=Edge

}

}

}

分享给朋友:
您可能感兴趣的文章:
随机阅读: