问题描述:

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

}

}

}

相关阅读:
Top