logo

JSON Home


Show

What is JSON?

JavaScript Object Notation is the full form of JSON.

  • It is a lightweight data interchange format
  • JSON is the simple plain text written in JavaScript Object Notation.
  • JSON acts as a transmitter because it is used to send data between two computers.
  • JSON is language liberated.

The JSON format was initially specified through Douglas Crockford and is defined in RFC 4627. The official Internet media kind for JSON is application/json. The JSON filename extension is .json. This tutorial will help you recognize JSON and its use inside numerous programming languages including PHP, PERL, Python, Ruby, Java, etc.

Note: The JSON syntax is acquired from JavaScript Object Notation, but the JSON format is text-only.

Special Codes for reading and generating JSON available in many programming languages.

Why use JSON?

The JSON formation is syntactically almost like the code for generating JavaScript objects. Due to this, a JavaScript program can simply transform JSON data into JavaScript objects.

Since the format is text only, JSON data can simply be sent between computers and employed by any programming language.

JavaScript features an inbuilt function for transforming JSON strings into JavaScript objects:

JSON.parse()

JavaScript also has a set up in function for transforming an object into a JSON string:

JSON.stringify()
  • You can obtain pure text from a server and use it as a JavaScript item.
  • You can send a JavaScript item to a server in pure text format.
  • You can work with information as JavaScript objects, without complex parsing and translations

Storing Data

When storing information, the information must be in a certain format, and irrespective of where you select to keep it, the text is continually one of the legal formats.

JSON makes it possible to keep JavaScript objects as text.

Audience

This tutorial has been designed to assist beginners to understand the primary functionality of JavaScript Object Notation (JSON) to develop the information interchange format. After finishing this tutorial, you'll have an excellent knowledge of JSON and how to use it with JavaScript, Ajax, Perl, etc.

Requirements

Before proceeding with this tutorial, you need to have a primary knowledge of the web application’s work over HTTP and we expect that you have a primary knowledge of JavaScript.