Blank page in IE6

Deadly 提交于 2019-12-06 11:16:31

This is a content-type problem from IE. It does not know how to handle application/xhtml+xml.

Although you write xhtml+xml, IE only knows text+html. It will be the future before all agents know xhtml+xml

change your meta tag with content type to content="text/html;

Sounds like bug #153 "Self Closing Script Tag" bug in IE, which is well known to cause blank pages.

Due to IE's bug, you can NEVER code the following and expect it to work in IE.

<script src="...." />

(if the tag is self closing, you are in for a world of pain)

Instead, always code as;

<script src="...."></script>

I had a similar problem that was language specific - only the page with multibyte characters didn't show in IE6 and IE7. Turns out in these two browsers, the order of the Content-Type meta tag and the title tag is a big deal. So putting the tag (which contained Japanese characters) after the meta tag fixed the problem.

Not sure if this exactly matches your experience. It depends on which specific version of IE (including service packs) is being used.

A known rendering issue with IE6 SP2 & IE7 (both use the same rendering engine) is the existence of orphaned tags in your HTML. This may be an orphaned div or script tag.

<script language="javascript">    // no closing tag
alert('hello world');
<body>
hello world
</body>

The above renders just fine in IE6 SP1 and Firefox, but you will only see a blank page in IE6 SP2 & IE7.

There are certain other tags that must have a separate closing tag. Check that any <div> and <script> tags have an ending </script> or <div> tag, not just a closing slash at the end of the opening tag. Another one is <textarea>. You have to have both tags.

You can test if this is occurring with your site if you can View Source of your blank page and get the source html even though your page is blank.

You should serve pages with the Content-Type header as text/html to IE users. You don't need to change the meta tag, just leave it as application/xhtml+xml (IE will ignore it).

I got this bug due to a typing error.

I wrote the meta tag :

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />

Thanks to you i corrected it to :

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

and i haven't the problem now.

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