开发者

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

开发者 https://www.devze.com 2023-01-26 02:00 出处:网络
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.

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 开发者_JS百科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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号