页面加载后,在浏览器中强制使用标准模式
我遇到一个问题,我的页面没有文档类型。
我无法在服务器上访问它,因此我无法自己添加文档类型声明。
这会导致浏览器以怪异模式呈现,并且几乎所有设计都需要针对不同浏览器版本的单独样式表。一些困难的布局甚至无法在 Firefox 上运行。
如果我能以某种方式告诉浏览器(也许通过 JavaScript)以标准模式渲染,所有这些问题都将结束。有什么我可以做的吗?
谢谢
下面OP评论的更新:
该页面是在我无法触及的范围内生成的,它只将我的HTML(可以包括javascript)放入其整个内容的一部分中。
这不是什么非法的东西,它只是一个自定义的 eBay 列表页面,我需要正常渲染它,而不是每次都崩溃并迫使我应用各种修复。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是解决方案: http://www.webmasterworld.com/forum91/4856.htm
请记住,
http://bytes.com/topic/ javascript/answers/167854-dynamically-change-doctype
Here is the solution: http://www.webmasterworld.com/forum91/4856.htm
Remember, that
http://bytes.com/topic/javascript/answers/167854-dynamically-changing-doctype