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
Before I start, let me emphasize that process.env...
MySQL has non-standard data types such as float a...
Demand background Part of the data in the busines...
Building an image is a very important process in ...
Main library binlog: # at 2420 #170809 17:16:20 s...
When using MySQL database, you often encounter su...
Table of contents 1. Scenario 2. Solution 3. Conc...
This article shares with you the specific method ...
Table of contents 1. MySQL time type 2. Check the...
1. Set up a shared folder on the virtual machine:...
The css animation of the rotating flip effect, th...
<br />For some time, I found that many peopl...
JSON (JavaScript Object Notation, JS Object Notat...
Table of contents 1. IDEA downloads the docker pl...
Table of contents 1.1. Network access between con...