Explain Json to me like I'm five

This question already has an answer here:

  • What is JSON and why would I use it? 16 answers

  • json is similar to filling your name slip on a book cover.

    在这里输入图像描述

    In json information is written in a structure, which helps every one understand information easily.

    In json your name slip will look like:

    {
    	"name": "Samimath",
    	"class": 1,
    	"sec": 1,
    	"subject": "english",
    	"rollno": 5,
    	"school": "Rainbow Public School",
    	"contact": 555666777
    }

    Json is a serialization format, allowing us to convert objects to strings and vice-versa.

    For example you might have a variable called Person

    var person = {
        Firstname: "Mike",
        Surname: "Smith"
    };
    
    var json = JSON.stringify(person);
    

    This will look like: {"Firstname":"Mike","Surname":"Smith"}

    We can also de-serialize by doing: var person2 = JSON.parse(json);

    By converting objects to strings we can exchange data with other systems, eg web services, databases, messaging etc. Json then works as a common format between these systems.

    链接地址: http://www.djcxy.com/p/47820.html

    上一篇: ActionResult vs JSONresult

    下一篇: 向我解释Json,就像我五岁