Rules for Syntax:
- Data should be represented in name/value pairs.
- Each data is separated by commas
- To hold the object, use the curly braces
- To hold an array, use square brackets
Advantages of JSON:
It is much faster than XML as the syntax is very small and light in weight.
2. Server Parsing:
The speed of the server depends on how fast the parsing is done at the server side so that JSON format itself supports easy parsing of data.
3. Tool for sharing data:
The files with any size can be shared using JSON. The video and audio files can also be easily shared.
Disadvantages of JSON:
1. Error Handling:
The errors cannot be handled for JSON calls.
2. Dynamic Script Limit:
When the dynamic script insertion works, JSON works perfectly but the insertion cannot be done in it. It fails without any intimation.
It can be hacked when used by untrusted services or browsers.