Home > Web Front-end > JS Tutorial > Solution to garbled characters in Get and post when js calls AJAX_javascript skills

Solution to garbled characters in Get and post when js calls AJAX_javascript skills

WBOY
Release: 2016-05-16 17:32:51
Original
969 people have browsed it

When using "get", add the encoding type


<%
Server side: servletactioncontext.getresponse().setcharacterencoding("utf-8");
Client web page special effects p/jsp.html target=_blank >jsp tutorial: < %@ page language="java" contenttype="text/html; charset=utf-8" pageencoding="utf-8"%>
response.expires = -9999
response.addheader "pragma", "no-cache"
response.addheader "cache-ctrol","no-cache"
response.addheader "content-type","text/html; charset=gb2312"'This is the key point, otherwise it will Garbled characters appear
response.write "Chinese characters"%>

2. Use vbscript to solve the encoding problem when using post:
The source code is as follows:
Copy code The code is as follows:



below The vbscript function is used:
Copy code The code is as follows:


< form name="user_info">
Name:

Age:

Gender:




Success
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template