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