Json

Total Post:113

Points:791
 99  View(s)
Ratings:
Rate this:

What is Json ? explain its functionality ?

  1. Post:140

    Points:984
    Re: Json

    JSON :

    JSON stands for JavaScript Object Notation.

    JSON is a lightweight data-interchange format .

    JSON is "self-describing" and easy to understand .

    JSON is language independent.

    We can also convert any JSON received from the server into JavaScript objects If you have data stored in a JavaScript object, you can convert the object into JSON, and send it to a server: 

    - Exchanging Data. 

    - Sending Data

    var myObj = { "name":"Prakash", "age":19, "city":"Allahabad" }; 
    var myJSON = JSON.stringify(myObj);
    window.location = "demo_json.php?x=" + myJSON;

    - Receiving Data 

    var myJSON = '{ "name":"Prakash", "age":19, "city":"Allahabad" }'; 
    var myObj = JSON.parse(myJSON); document.getElementById("demo").innerHTML = myObj.name; 

    - Storing Data

    //Storing data in local server:

    myObj = { "name":"Prakash", "age":19, "city":"Allahabad" };
    myJSON = JSON.stringify(myObj);
    localStorage.setItem("testJSON", myJSON);

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!