Change IE9 Document Mode to IE9 Standards

╄→гoц情女王★ 提交于 2019-12-01 10:44:54

You state that the browser is defaulting to Quirks mode.

The correct solution to getting out of Quirks mode is to use a DOCTYPE.

Make sure that your HTML code starts with the following line:

<!DOCTYPE html>

This should be the first line of code, above the <html> tag.

The X-UA-Compatible flag is good thing to have, but isn't relevant to your problem in this case. It tells IE to switch between various compatibility modes, but Quirks mode is a whole separate thing, and is controlled by the existence or not of the doctype.

You should keep the X-UA-Compatible flag, although as I said in the comments, you would be better to set it to IE=edge rather than IE=9, otherwise you're going to have problems with IE10 and later.

Hope that helps.

[EDIT]

We have now established that the OP's site is running in a frame, inside another site that is in quirks mode.

This is a big problem because IE will render all frames in the same mode, so if the parent site is stuck in quirks mode then his site will also be stuck in quirks mode.

There is pretty much nothing that can be done about this, other than converting one or other site to be in the same mode as the other.

Converting the new code to run in quirks mode might be possible, but is very risky; I would strongly recommend against it. In any case, I would need to spend time studying the whole of your source code before I'd even be able to say whether it's possible or not, let alone how much work it is.

Converting the old code to run in standards mode is likely to be more achieveable. Again, it depends on how large the code base is, but the main point is that you don't need to worry about the conversion breaking due to unsupported features, because the site is already running in an old mode; moving to the newer mode might require some changes, but at least you can be fairly sure from the start that it is possible.

The only other option you have is to change your site so that instead of being in a frame, it pops out into its own separate window (or tab). This way, it can stay in standards mode and the old site can stay in quirks mode. This is the only option you have that doesn't involve a lot of work.

I guess the ultimate message from all of this is that quirks mode is a terrible thing. The world would be a much better place if all those old corporate systems out there running in quirks mode would be upgraded to use standards mode. It really is a lot less effort than people think, and will prevent nasty situations like this one.

use content="IE=edge" instead of IE=9 this will force your IE browser to stick to latest available

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!