- Back to Home »
- PHP Training in Chandigarh , Uses of JSON , what is JSON »
- What are the uses of JSON
Posted by : CBitss Technologies
Tuesday, 5 December 2017
What is JSON?
JSON stands for JavaScript Object Notation is a slight data interchange format. JSON is easy for machines to parse and generate and also it is very easy to read and write by human. It is an subset of the JavaScript Programming Language. JSON is a complete independent language.
- JSON is a lightweight data-interchange format.
- JSON is self-describing and easy to understand.
Why use JSON?
When the JSON format is text it can easily be sent to and from a server, and used as a data format by any programming language. JSON is used in PHP to know more go for PHP Training in Chandigarh. JavaScript has a built in function to convert a string, written in JSON format, into native JavaScript objects.
JSON.parse()
JSON is portable because parsers and writers are available for many languages.JSON is that a PHP script generates can be very easily understood by a JavaScript script. It is the best way to transmit complex structures like arrays and objects and have it still be adaptable with multiple languages.
Data that is hardly defined is more difficult for humans to understand or debug, and work with. If you wanted to debug a response between your server and your browser and the data was delimited , you might have a hard time understanding it. Also, if you want to add different data types, provide separate records, etc., then your custom data format becomes more complicated.
What are the Uses of JSON?
The Uses of JSON are given below:-
- It is used while writing JavaScript based applications that includes browser extensions and websites.
- JSON format is used for serializing and transmitting structured data over network connection.
- It is primarily used to transfer data between a server and web applications.
- Web services and APIs use JSON format to provide public data.
- It can be used with modern programming languages.
JSON with AJAX
AJAX is Asynchronous JavaScript and XML, which is used on the client side as a group of interdependent web development techniques, in order to create asynchronous web applications. Most of the developers use JSON to pass AJAX updates between the client and the server.
Any data that is updated using AJAX can be stored using the JSON format on the web server. AJAX is used so that javascript can fetch these JSON files when necessary, parse them, and perform one of the following operations −
- Store the parsed values in the variables for further processing before displaying them on the webpage.
- It directly appoints the data to the DOM elements in the webpage, so that they are displayed on the website.

