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
Preparation 1. The master and slave database vers...
First, let's simulate the data coming from th...
Use meta to implement timed refresh or jump of th...
This article shares the specific code of JS to ac...
This article describes various ways to implement ...
The reason is this I wanted to deploy a mocker pl...
This tutorial shares the specific code of MySQL5....
Front-end is a tough job, not only because techno...
Table of contents environment Install CentOS Conf...
Table of contents 1. Component Communication 1. P...
Preface In today's increasingly convenient In...
lead Some common triangles on web pages can be dr...
1. HTML Image <img> 1. The <img> tag ...
This article describes how to use docker to deplo...
The project was tested these days, and the tester...