Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

Meta X-UA-Compatible does not work IN IE 11 when rendering with document.write

$
0
0

We have requirements to force IE 11 to IE 10 mode, right now this can be done by html doc type and meta X-UA-Compatible, for example I have a html page like below, and when I open this page in IE11, the document mode is IE 10 now. 

<!DOCTYPE HTML><html><head><script>alert("hahah"); </script><meta http-equiv="X-UA-Compatible" content="IE=10"></head><body>this is content</body></html>


But under some circumstance, we need to generate the html on fly in javascript, and render the generated html to page by js code similar to below: 

var h = '<!DOCTYPE HTML><html><head><meta http-equiv="X-UA-Compatible" content="IE=10"><script>alert("hahha"); </script></head><body><b>this is content</b></body></html>';
parent.document.write(h); 


In this case, even I have doc type and meta in the html, but this page is changed to edge mode. 

Could anyone help how to write the generated html to document and keep document mode in IE 10? 

Thanks



Viewing all articles
Browse latest Browse all 3527


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>