JavaScript Fourth Week study

Source: Internet
Author: User

This week to learn some JS advanced part of JSON

JSON is simply called objects and arrays in JavaScript, so these two structures are objects and arrays of two structures that can represent a variety of complex structures.

Java Script Object Notation

JSON is the syntax for storing and exchanging textual information, like XML,

JSON is smaller, faster, and easier to parse than XML.

JSON is a lightweight text data interchange Format

JSON independent of language

JSON is self-descriptive and easier to understand

JSON values are key-value pairs that appear

Styles written under JSON
{
"Employees": [
{"FirstName": "Bill", "LastName": "Gates"},
{"FirstName": "George", "LastName": "Bush"},
{"FirstName": "Thomas", "LastName": "Carter"}
]
}
Need to be used to parse

JSON is more convenient to write in JavaScript files without parsing.

The JavaScript program is able to use the built-in eval () function, using JSON data to generate the original

The native JavaScript object.

* * Similar to xml**

1. JSON is plain text

2. JSON has "self-descriptive" (Human readable)

3. JSON has a hierarchy (values exist in value)

4. JSON can be parsed by JavaScript

5. JSON data can be transmitted using AJAX

* * Compared to XML differences * *

1. No end tag

2. Shorter

3. Read and write more quickly

4. Ability to parse using the built-in JavaScript eval () method

5. Using arrays

6. Do not use reserved words

The **json value can be: * *

1. Number (integer or floating point)

2. String (in double quotes)

3. Logical value (TRUE or FALSE)

4. Array (in square brackets)

5. Object (in curly braces)

6. Null

This is who the call refers to

# # Object Basics # #

An object is a set of unordered sequences of raw data types (or reference data types), and the sequence is keyed

value pairs. Each item in a sequence is called a property (a function is called a method), and each

The property name must be unique.

* * Reference Data type * *

Numbers (number)

Strings (String)

Boolean (Boolean)

Undefined (Undefined)

Null (NULL)

* * RAW Data type * *

Functions (function)

Object (OBJECI)

Arrays (Array)

Array object (OBJECI) null (NULL) These three items are returned as object, and the other

Are the data types themselves.

JavaScript Fourth Week study

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.