Is there a way to switch a page in quirksmode to standards mode using Javascript?
For example, assuming I have the following page with html in it. I've tried the following.
<html><script src="js.js"></script></html>
and the following content in js.js
document.open();
document.write('<!doctype html><html></html>');
document.close();
From looking at the output above I'm basically trying to convert a page in quirksmode to standards mode, but it doesn't work. (setting the contents of a page like above on an iframe works fine)
iframe Works
It works you do document.createElement('iframe')
append into the document and call iframe.contentWindow.document.write('<!doctype html>..');
on it. Unfortunately the same technique does not if I'm calling it on the current page.
Does anyone have a working fix switching a page in quirksmode to standards mode?
EDIT: Creating and appending an iframe and simply setting its height and width to 100%, works but isn't the goal here ;)
document.write
doesn't work, but I find it funny that it works if you create an iframe. I wonder why? – Hansom