Showing posts with label JSON. Show all posts
Showing posts with label JSON. Show all posts

Tuesday, 24 September 2013

JSON: What It Is, How It Works, & How to Use It

The ability to load and manipulate JSON feeds from other sites via AJAX. Many sites are sharing data using JSON in addition to RSS feeds nowadays, and with good reason: JSON feeds can be loaded asynchronously much more easily than XML/RSS. This article will cover the following:
  • What is JSON?
  • Why does JSON matter?
  • How do we use JSON in a project?
We’ll also use our newfound skills with JSON at the end of this project to build a quick app that loads photos from Flickr without requiring a page refresh.
WHAT IS JSON?
JSON is short for JavaScript Object Notation, and is a way to store information in an organized, easy-to-access manner. In a nutshell, it gives us a human-readable collection of data that we can access in a really logical manner.
Reference : COPTER LABS

Wednesday, 3 July 2013

WHY USE JSON OVER XML?


There are times when you may be unsure what format to choose when transmiting data between a server and web application. Here are a few reasons why you might choose to use JSON rather than XML and a few why you might choose XML rather than JSON.
What is JSON?
JavaScript Object Notation (JSON) is a lightweight text-based open standard designed for human-readable data interchange. It is derived from the JavaScript programming language for representing simple data structures and associative arrays, called objects. Despite its relationship to JavaScript, it is language-independent, with parsers available for most programming languages.
What is XML?
Extensible Markup Language (XML) is a set of rules for encoding documents in machine-readable form. XML’s design goals emphasize simplicity, generality, and usability over the Internet.

 Reasons to choose JSON over XML

1.    JSON requires less tags than XML – XML items must be wrapped in open and close tags whereas JSON you just name the tag once
2.    Because JSON is transportation-independent, you can just bypass the XMLHttpRequest object for getting your data.
3.    JavaScript is not just data – you can also put methods and all sorts of goodies in JSON format.
4.    JSON is better at helping procedural decisions in your JavaScript based on objects and their values (or methods).
5.    You can get JSON data from anywhere, not just your own domain. There’s no more proxy server nonsense.
6.    Yahoo has a really good YUI2 JSON API.
7.    JSON is easier to read than XML – Obviously a personal preference

Reasons to choose XML over JSON

1.    Easy to take XML and apply XSLT to make XHTML.
2.    XML is supported by many more desktop applications than JSON.
3.    JSON can be put in the XML on the way back to the client – the benefit of both! It’s called XJAX (stands for X-domain JavaScript And XML).

4.    Simply, AJAX includes XML in it and not JSON.