Home >Web Front-end >HTML Tutorial >Solution to the problem that ie7 opens the page with source files but the page is blank_HTML/Xhtml_Web page production

Solution to the problem that ie7 opens the page with source files but the page is blank_HTML/Xhtml_Web page production

WBOY
WBOYOriginal
2016-05-16 16:43:141511browse

Question:
The encoding of my blog is UTF-8. Sometimes the page is blank when you open it, and it is normal again after refreshing, but when you view the source file, it is complete. It's normal under IE6 and Firefox, but this happens occasionally under IE7.
At first I suspected it was an IDC problem, but then I thought about js, css, page structure, etc. By chance I thought about coding. After all, coding issues have not troubled me once or twice.
Solution:

Script House

Exchange the order

LC'BLOG
Reason:
Why does this problem only occur in IE7? This is because when ie7 parses the web page encoding, the tags in the html are given priority, followed by the information in the http header, while the Mozilla series of browsers do the opposite.
Because the UTF-8 encoded page represents one Chinese character with 3 bytes, while the ordinary gb2313 or big5 has two bytes. When the page is output, due to the above reasons, when the browser parses and outputs the content of , if there are an odd number of full-width characters before , IE7 will treat UTF-8 as two bytes when parsing it. In the case of half a Chinese character, the half Chinese character will be combined with the " to form a garbled word, causing IE7 to be unable to read the
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn