Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force standards-mode in browsers, after the page has loaded

I'm having a problem where i have a page that does not have a doctype.

I can't access it on the server so i can't add a doctype declaration myself.

This causes browsers to render in quirks mode and almost all designs need separate stylesheets for different explorer versions. Some difficult layouts don't even work on Firefox.

All of these problems would end if I could somehow tell the browsers (via JavaScript perhaps) to render in standards mode. Is there something I can do?

Thank you


Update from OP comment, below:

The page is generated out of my reach and it only puts my HTML (that can include javascripts) into a portion of its entire content.

It's nothing illegal or anything, it's just a custom ebay listing page that i need to render normally instead of collapsing every time and forcing me to apply all sorts of fixes.

like image 659
Marius Avatar asked Nov 15 '22 05:11

Marius


1 Answers

Here is the solution: http://www.webmasterworld.com/forum91/4856.htm

Remember, that

As for changing that with DOM methods, the W3C DOM Level 2 Core says: "docType cannot be altered in any way, including through the use of methods inherited from the Node interface, such as insertNode or removeNode."

http://bytes.com/topic/javascript/answers/167854-dynamically-changing-doctype

like image 163
Vladislav Rastrusny Avatar answered Dec 09 '22 19:12

Vladislav Rastrusny