Solution to the problem that the page is blank when opening the page with source file in IE7

Solution to the problem that the page is blank when opening the page with source file in IE7
question:
My blog encoding is utf-8. Sometimes when you open the page it is blank, but it becomes normal after refreshing it, but when you check the source file it is complete. It works fine in IE6 and Firefox, but it occasionally happens in IE7.
At first I suspected it was an IDC problem, but then I thought about js, css, page structure, etc. I thought of coding by accident. After all, encoding problems have troubled me more than once or twice.
solve:
<title>123WORDPRESS.COM</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
Swap the order
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>LC'BLOG</title>
reason:
Why does this problem only occur in IE7? This is because IE7 prioritizes the tags in HTML and then the information in HTTP header when parsing web page codes, while the Mozilla series of browsers are just the opposite.
Because the UTF-8 encoded page is 3 bytes to represent a Chinese character, while the ordinary GB2313 or Big5 is two. When the page is output, due to the above reasons, when the browser parses and outputs the content of <title></title>, if there is an odd number of full-width characters before </title>, IE7 will parse UTF-8 as two bytes and half of a Chinese character will appear. At this time, the half Chinese character will be combined with the "<" of </title> to form a garbled character, causing IE7 to be unable to read the <title> part, resulting in the entire page being output as blank. If you check the source file at this time, you will find that the entire leaf surface has actually been output.
Therefore, the simplest solution is to put the character definition <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> before <title></title> in the <head></head> tag of the web page file.
In fact, similar problems exist in other encoding versions, but the default encoding of our browsers is GBK, so it is less likely to be detected.

<<:  The best solution for resetting the root password of MySQL 8.0.23

>>:  Implementation of docker-compose deployment project based on MySQL8

Recommend

Understand the principles of MySQL persistence and rollback in one article

Table of contents redo log Why do we need to upda...

MySQL scheduled task implementation and usage examples

This article uses examples to illustrate the impl...

XHTML Getting Started Tutorial: XHTML Hyperlinks

It is no exaggeration to say that hyperlinks conne...

MySql grouping and randomly getting one piece of data from each group

Idea: Just sort randomly first and then group. 1....

How to set PATH environment variable in Linux system (3 methods)

1. In Windows system, many software installations...

Detailed explanation of Vue project optimization and packaging

Table of contents Preface 1. Routing lazy loading...

mysql indexof function usage instructions

As shown below: LOCATE(substr,str) Returns the fi...

Layui implements the login interface verification code

This article example shares the specific code of ...

Complete step-by-step record of MySQL 8.0.26 installation and uninstallation

Table of contents Preface 1. Installation 1. Down...

Detailed explanation of js closure and garbage collection mechanism examples

Table of contents Preface text 1. Closure 1.1 Wha...

Write a React-like framework from scratch

Recently I saw the article Build your own React o...

MySQL operations: JSON data type operations

In the previous article, we introduced the detail...