Solve the problem that the responseText returned by the server after ajax processing is JSON data. First, the contents of the file in json format are as follows: { "city":"ShangHai", "telephone":"123456789" } Second, the json data returned by the server is the above content in responseText. Now we need to get it out. There are two ways: Method 1: var json = JSON.parse(request.responseText); alert(json.city); Method 2: var result = request.responseText; var jsonObject = eval("("+result+")"); alert(jsonObject.telephone); This is the end of this article about the detailed case of Ajax responseText parsing json data. For more related Ajax responseText parsing json data content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Detailed explanation of the installation and configuration process of mysql8.018 on linux
>>: Nginx prohibits direct access via IP and redirects to a custom 500 page
Managing disk space is an important daily task fo...
In the vue scaffolding, we can see that in the ne...
Table of contents 1. Install JDK Manual Installat...
Preface First, let's see how to identify a TC...
Table of contents 1. Overview 2. nginx.conf 1) Co...
Recently, new projects have used springcloud and ...
nginx Overview nginx is a free, open source, high...
question: Recently, garbled data appeared when de...
Preface: Recently, I encountered a management sys...
Why mention textarea specifically? Because the tex...
1. System Configuration 1. Turn off sudo password...
1. The organizational structure of the hypertext d...
Problem background: When using docker to deploy t...
Table of contents Installation Environment Descri...
After reading the following article, you can depl...