Subset of computer language which used to storing and exchanging data, extended from JavaScript. Json stands for JavaScript Object Notation. it is language independent data format, which means it can be read by any programming language to interchange data.
why json is language independent?
JSON has JavaScript syntax, but it uses text format like xml, this text format can be used any programming language to interchange data. read more on web...
why json is language independent?
JSON has JavaScript syntax, but it uses text format like xml, this text format can be used any programming language to interchange data. read more on web...
how to use json
JSON provides an simple and human understandable way to store data structure within JavaScript syntax. First we should create variables to hold data like another computer language, then we can use JSON to define Json Objects.
To run the code click on code
In this example <script> tag means it is JavaScript (JS) syntax and var define variable name faulty, after this store Name property of faulty object in curly braces. alert is the JS alert its open JS alert message box when this script run on the browser(JS enabled). alert print/popup/show defined name of JSON Object called faculty
In this example <script> tag means it is JavaScript (JS) syntax and var define variable name faulty, after this store Name property of faulty object in curly braces. alert is the JS alert its open JS alert message box when this script run on the browser(JS enabled). alert print/popup/show defined name of JSON Object called faculty
advantages of json
XML is also data interchanging language. So XML is a alternative language for JSON. Because JSON has some advantages and disadvantages with XML
Read more on web...
- JSON is faster and it has higher human readability
- It is language independent
- Much simpler than XML
- Lightweight and It has self describing nature
Read more on web...
Applications and examples
JSON mainly uses in web developing areas. Its use to encode information returned by server and recreate a object in client. Simply it is used to handle data
Applications
JSON-RPC is an RPC protocol built using JSON (Wikipedia). It is a protocol which use system to send notifications and multiple calls to the server that can be answered out of order.
Using with Ajax to handle client data
JSON examples (To run click on the code)
JSON data can publish using HTML via JavaScript syntax
Applications
JSON-RPC is an RPC protocol built using JSON (Wikipedia). It is a protocol which use system to send notifications and multiple calls to the server that can be answered out of order.
Using with Ajax to handle client data
JSON examples (To run click on the code)
JSON data can publish using HTML via JavaScript syntax
Here <html> tag means this is html file and it has embedded JavaScript. Before go to JS CSS <div> tag means in this place have a css devision element. We can use JSON as a place holder to fill this DIV locaton with JSON data using JS. In JS student JSON Object define with three attributes firstName,lastName and age. Finally print the data on web page using JS and html. In this example JSON act as a data placeholder
Store data in JSON arrays and retrieve stored data
Store data in JSON arrays and retrieve stored data
In this example store two students data in JSON array and print on the web page. [] is the JSON array notation. We can create JSON Object array using this {"array_name":[{Object0},{Object1}....]} and it can store in array variable. JSON Array elements can be access using array_variable.array[INDEX].Object_attribute
Also JSON can use construct data lists, With JQuery libraries and C++, PHP and etc. JSON'S language independent and lightweight simply characteristics make it more usable and fastest data interchanging language and its spread on wide area of web developing and other computer data using fields.
Also JSON can use construct data lists, With JQuery libraries and C++, PHP and etc. JSON'S language independent and lightweight simply characteristics make it more usable and fastest data interchanging language and its spread on wide area of web developing and other computer data using fields.