Blank page in IE6
A site I am working on that is built using PHP is sometimes showing a completely blank page. There are no error messages on the client or on the server. The same page may display sometimes but not others. All pages are working fine in IE7, Firefox 3, Safari and Opera. All pages are XHTML with this meta element:
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
It appears that I have fixed the problem by adding this PHP code:
header('Content-type: text/html; charset=utf-8');
I have read that this problem may be caused by XHTML, encoding, gzip compression, or caching, but nobody has been able to backup these guesses.
As the problem was intermittent I am not confident that my solution has actually solved the problem.
My question is, are there reproducible ways of having IE6 show a blank page when other browsers display content? If so, what causes it and what solves it?
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.
链接地址: http://www.djcxy.com/p/18974.html上一篇: 在脚本标记中何时需要CDATA部分?
下一篇: IE6中的空白页面