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
Table of contents redo log Why do we need to upda...
This article uses examples to illustrate the impl...
It is no exaggeration to say that hyperlinks conne...
css3 background image related Compatibility: IE9+...
Idea: Just sort randomly first and then group. 1....
1. In Windows system, many software installations...
Table of contents Preface 1. Routing lazy loading...
As shown below: LOCATE(substr,str) Returns the fi...
This article example shares the specific code of ...
Table of contents Preface 1. Installation 1. Down...
Table of contents Preface text 1. Closure 1.1 Wha...
Recently I saw the article Build your own React o...
For .net development, I am more familiar with Mic...
In the previous article, we introduced the detail...
1. Introduction MySQL is used in the project. I i...