Home  >  Article  >  Web Front-end  >  How to deal with garbled html code in jquery

How to deal with garbled html code in jquery

coldplay.xixi
coldplay.xixiOriginal
2020-12-07 17:14:273639browse

Solution to garbled HTML in jquery: 1. Open the Jquery code with text or word, then save it as and change its encoding method; 2. Modify the encoding in the relevant tags in the [web.config] file ;3. Modify the code in [

How to deal with garbled html code in jquery

The operating environment of this tutorial: windows7 system, jquery3.2.1 version, Dell G3 computer

Recommended: jquery video tutorial

Solution to garbled HTML in jquery:

1. When importing Jquery code: other text in the web page is normal, but the Jquery code displays abnormally.

Solution: Open the Jquery code with text (.txt) or word, then save it as and change its encoding (usually to utf-8 or gb2312).

2. When you want to change the coding problem of the entire website in ASP.NET.

Modify in the web.config file<globalization requestEncoding="gb2312" responseEncoding="gb2312" culture="zh-CN" fileEncoding="gb2312"/> in the tag Encoding</p> <p>3. When the html web page encoding appears garbled. </p> <p>Just modify <code>charset=utf-8 in etc.

Note: Commonly used encoding types in web pages: utf-8, gb2312, gbk, etc.

Related free learning recommendations: javascript(Video)

The above is the detailed content of How to deal with garbled html code in jquery. For more information, please follow other related articles on the PHP Chinese website!

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