This function is a serialized object. is to convert the type of the original object into a string type (JSON type).
Syntax:
Json.stringify (value [, Replacer] [, space])
Value: is the required field. Is the object you have entered, such as array Ah, class AH and so on.
Replacer: This is optional. It is divided into 2 ways, one is method, the second is an array.
Situation one: We first say the data, through the experiment behind us, we can know that it is related to the first one. In general, our serialization results are represented by key-value pairs.
For example:
Name: "LAN", age:25
This form.
So, if this is the case, if the value of the second exists in the first, then the value of the second is the key, the first value for value is represented, if it does not exist, sorry, ignore. "It's not a bit abstract, I think so, but you just wait and see the experiment is OK." Whirring 】
Situation Two: If it is a method, it is very simple, that is, the serialization of each object (remember that every one) into the method of processing.
Space: Well understood, with what to do the delimiter.
1. If omitted, then the displayed value does not have a separator character. Direct output to
2. If it is a number, then it is defined to indent a few characters, of course, if it is greater than 10, the maximum value is 10.
3. If there are some escape characters, such as "\ T", which means carriage return, then it is a carriage return per line.
4. If it is just a string, OK, append the strings to the output value in each row. Of course, the maximum length is also 10 characters.
Example reference:
Http://www.jb51.net/article/29893.htm
Json.stringify ()