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

How to configure MySQL master-slave synchronization in Ubuntu 16.04

Preparation 1. The master and slave database vers...

Implementation of react loop data (list)

First, let's simulate the data coming from th...

Implementing timed page refresh or redirect based on meta

Use meta to implement timed refresh or jump of th...

JS realizes the effect of Baidu News navigation bar

This article shares the specific code of JS to ac...

Summary of various implementation methods of mysql database backup

This article describes various ways to implement ...

MySQL 5.6.22 installation and configuration method graphic tutorial

This tutorial shares the specific code of MySQL5....

4 solutions to CSS browser compatibility issues

Front-end is a tough job, not only because techno...

Eight ways to implement communication in Vue

Table of contents 1. Component Communication 1. P...

Ubuntu 20.04 firewall settings simple tutorial (novice)

Preface In today's increasingly convenient In...

Detailed explanation of triangle drawing and clever application examples in CSS

lead Some common triangles on web pages can be dr...

Analysis of centos6 method of deploying kafka project using docker

This article describes how to use docker to deplo...

Vue implements automatic jump to login page when token expires

The project was tested these days, and the tester...