What is a JSON file?

What is a JSON file?

Facebooktwitterlinkedin

What is a JSON file?

As name suggest JSON means JavaScript Object Notation which is a way to store information in an organized, easy-to-access manner. JSONs gives us a human readable collection of data to which we can access in a really logical manner. JSON file stores simple data structures & objects. It contains lightweight, text-based, and human-readable data in a standard data interchange format. Actually JSON file were originally based on a subset of Java Script but is considered a language independent format which is being supported by many different programming APIs.

JSON is been used for Many web applications for the purpose of data interchange and they not save “.JSONs” files actually on the hard drive and the data interchange is been getting done between internet connected computers. Some applications enable users to save it in “.JSONs” files.
For eg: – Google+ uses JSON file for saving profile data. You can choose the “data liberation” page when you logged in & select “download your profile data”.
In Ajax web application programming “JSON” is commonly used. The popularity of JSON is increasing as an alternative to XML now days.

Why use JSON?

JSON can easily be sent to and from a server because. JSONs format is text only and used as a data format by any programming language. To convert a string JavaScript has a built in function, written in JSONs format, into native JavaScript objects: JSONs.parse()
In JSON format if you receive data from a server than you can use it like any other JavaScript object.

Why JSON preferred over XML?

JSON and XML are totally two different data formats. Which we commonly do use in the Web for Data interchange purpose. JSON was specified by Douglas Cockford in 2002 and XML was specified by W3C in the 90s and. Putting java script or JSON Object Notation is a more lightweight data interchange format as compared to XML.

One reason why over XML JSON file is preferred is this is a more readable format compared to the latter’s rather verbose form. XML do use a whole lot of opening and closing tags and JSON simply uses {} for objects, [] for arrays, and this makes it much more lightweight. This is used for fast transmission & processing and even the desterilizing and serializing. JSON’s representation of objects and arrays make for more direct mapping and easier and with to the corresponding data structures unlike XML that has to be parsed, and it can often be difficult to make out which is an object, which is an array.

How to open JSON file:-

Not all web applications save JSON files for backup. Especially when the data interchange occurs. Between two devices connected to the Internet. If you use Mozilla Firefox, the browser automatically saves backup files of your bookmarks in the JSON format.
You can locate JSON files in the Firefox folder, which is labeled Bookmark Backups, or you can choose to save bookmark files to an external storage device and then import them whenever you install a new version of Firefox. Or whenever you want to open JSON files, all you have to do is import the files into your browser.

If you use Windows, you can open JSON files with Notepad or other type of text editor to view the contents. Simply right click on the file and then choose Open With from the drop-down menu. Click on Notepad on the submenu or click Browse if Notepad is not listed to open and view JSON files. You may also use WordPad or Altova XMLSpy to open these files.

For Mac OS X you can open JSON files using Apple TextEdit or other compatible text editor which will allow you to view the contents. You can also use Bare Bones TextWrangler which is a text and HTML editor designed for Mac PCs or MacVim designed for Mac OS X.

If you use Linux, you can open and view JSON files with Vim for Linux, which is a highly configurable text editor, or you can use another editor such as Pico or GNU Emacs.
JSON files can also be opened by all three previously mentioned operating systems using Mozilla Firefox. Additionally, Firefox offers an add-on known as JSONView which will open and display JSON file extensions similar to how XML documents are shown.

Facebooktwitterlinkedin
About the Author