views:

81

answers:

4

Hi. I want to, in brief, find out about what I can do with JSON; whether it is an alternative for JavaScript or what?

+9  A: 

JSON is short for JavaScript Object Notation. It is a data format used for passing around data, modeled after the Javascript syntax for object/list literals. It is not a programming language, but rather a data markup language.

Amber
As a data markup language, it can be an alternative to XML.
Thilo
And while it is modelled on JavaScript syntax, it can be used (written and read) by many other languages as well.
Thilo
and it's a good way to exchange information between your JS and your server
pleasedontbelong
+1  A: 

In a brief JSON is JavaScript Object Notation. Which for example instead of doing:

var obj  = new Object( );
obj.arr  = new Array( );
obj.name =  new String ( "Jhon Doe");

You can do:

var obj = { name: "Jhon Doe", arr: [1,2,3,4]};

So once browser will receive or meet some peace of JSON it would be able to compile it into Javascript object, so you will be able to use itt later in the code and reference to it.

Artem Barger
+2  A: 

It's just a data format that converts data structures such as objects & arrays into a string representation. It uses the same format as javascript and is very easy to work with in ajax based applications because of this.

What can you do with json? anything that any other major data format can do. It's just data. What you can do with it is up to you.

Ben Rowe
+2  A: 

JSON (an acronym for JavaScript Object Notation) is a lightweight text-based open standard designed for human-readable data interchange. It is derived from the JavaScript programming language for representing simple data structures and associative arrays, called objects

JSON is built on two structures:

  • A collection of name/value pairs.
  • An ordered list of values.

For more on JSON

Sam Rudolph