Getting Started with JSON: A Lightweight Data Interchange


News: Getting Started with JSON: A Lightweight Data Interchange

  1. JSON (Java Script Object Notation) provides a simple data format for the exchange of information between the browser and server. In other words JSON is light weight data-interchange format. Now you can see from above code that it has the potential to store any data type of information. We can store strings, integer, float, arrays, function or even other objects inside as per our requirement and JSON does not even bother about the type of data.

    You can find the answers to the following questions in this tutorial: JSON Javascript Tutorial

    (1)   Why JSON

    (2)   Using JSON?
    (3)   Accessing data in JSON
    (4)   Get JSON via AJAX
    (5)   JSON with other sever side scripts
    (6)   Future of JSON

    JSON Javascript Tutorial

    Threaded Messages (4)

  2. why json?[ Go to top ]

    When we have serializable objects...why to go for JSON?


  3. Re: why json?[ Go to top ]

    You use JSON to exchange data over between client and server, for example with JavaScript on the client and java on the server.

  4. Ease of use[ Go to top ]

    Ever tried to plain text read a serialized object? JSON is easier for debugging.

  5. 2 simple questions[ Go to top ]

    As far as I can understand, you can serialize only primitives, arrays and full objects.

    1) Can you reference a constant in JSON? i.e., if my javascript has a constant like X=10 , can I punt X in my JSON? I ask because I wrote an app using google maps api, and I wanted to instruct the map using json. I was able to do that, but not for a parameter, the mapt type. To set the map type, you have to pass to the map the javasctipt client side object. So I cannot contruct the parameter from the server side.

    2) Can you reference objects passed in another place from json? I mean, how I resolve circular references?


    thanks and sorry for the noob questions...