Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What exactly is JSON?

Tags:

json

I'm new to the web application domain. I have been watching some hot and eye-catching discussions regarding JSON everywhere.

Can someone briefly explain what JSON is? Do you have links to websites or forums that can help enlighten me about JSON?

like image 426
Hemanth Avatar asked Nov 30 '10 03:11

Hemanth


People also ask

What is the purpose of JSON?

JavaScript Object Notation (JSON) is a standard text-based format for representing structured data based on JavaScript object syntax. It is commonly used for transmitting data in web applications (e.g., sending some data from the server to the client, so it can be displayed on a web page, or vice versa).

What is JSON and example?

JSON stands for Javascript Object Notation. JSON is a text-based data format that is used to store and transfer data. For example, // JSON syntax { "name": "John", "age": 22, "gender": "male", } In JSON, the data are in key/value pairs separated by a comma , . JSON was derived from JavaScript.

What the heck is JSON?

JSON, or JavaScript Object Notation, is a lightweight data-interchange format. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition – December 1999.

What is difference between HTML and JSON?

The JSON Rich Text Editor stores content in plain text format, which can be understood and processed by all programming languages. Whereas the HTML RTE is limited and constrained to HTML markup.


2 Answers

JSON (JavaScript Object Notation) is a data storage language, a bit like XML, but uses a more familiar "dictionary" style syntax and semantics. For example, I can store an address book in JSON:

[{"Name": "Jane", "Address": "28 Seventh St", "Age": 27},
 {"Name": "Steve", "Address": "14 Ninth St", "Age": 25}
]

Notice that it looks a lot like a Python or JavaScript dictionary and list syntax. That's basically all it is: a serialisation of these six basic data types:

  • Object (or a "dictionary")
  • Array (or a "list")
  • String
  • Number (integer and float)
  • Boolean (true and false)
  • null

More information at json.org.

Note that although it has "JavaScript" in the name, it is really easy to read and write JSON data from any language, though the data structure is best represented in dynamic languages like JavaScript and Python. The website has a huge list of implementations in various languages.

like image 57
mgiuca Avatar answered Nov 05 '22 21:11

mgiuca


From json.org:

JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, Python, and many others. These properties make JSON an ideal data-interchange language.

like image 26
Hamish Avatar answered Nov 05 '22 21:11

Hamish