4 ms·
Okay so I wondered whether we can leverage XSLT in order to render the JSON without quirks mode. The idea is: * We have an XSL stylesheet that ignores input an
by flyx86 6y ago
Okay so I wondered whether we can leverage XSLT in order to render the JSON without quirks mode. The idea is:
* We have an XSL stylesheet that ignores input and renders out the HTML contained in "#render"
* Along with the JSON file, we send a header `Link </stylesheet.xsl>; rel="stylesheet"; type="text/xsl"`
* We send the JSON with `Content-Type application/xml`
* Browser renders the HTML via the stylesheet and then the JavaScript takes over and renders the page without quirks mode
Sadly, this doesn't work because when the browser can't parse the JSON as XML, it stops processing and doesn't call the stylesheet :(