AJAX uses JSON data format case _ajax related

Source: Internet
Author: User
Tags eval

1:

JSON (Javascriptobject notation) is a simple data format that is lighter than XML. JSON is the native format of JavaScript, which means that processing JSON data in JavaScript does not require any special APIs or toolkits.
The rule of JSON is simple: an object is an unordered set of ' name/value pairs '. An object begins with "{" (opening parenthesis), and "}" (closing parenthesis) ends. Each "name" is followed by a ":" (a colon), and the ' name/value ' pair is separated by a ', ' (comma).
JSON assigns a value with a colon rather than an equal sign. Each assignment statement is separated by a comma. The entire object is encapsulated in curly braces. Nested data can be graded with curly braces.
The data stored in the object description can be a string, a number, or a Boolean value. Object descriptions can also store functions, which is the object's method.

<span style= "FONT-SIZE:18PX;" >{"Person": { 
"name": "Andy Budd", 
"website": "http://andybudd.com/", 
"email": "andy@clearleft.com" 
} 
} </span>

JSON is just a text string. It is stored in the ResponseText property
In order to read the JSON data stored in the ResponseText attribute, you need to base the Eval statement on JavaScript. The function eval will take a string as its argument. The string is then executed as JavaScript code. Because the string of JSON is composed of JavaScript code, it is itself executable

2: Cases

<%@ page language= "java" pageencoding= "UTF-8"%>  
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.