JSON

From Uweb

Jump to: navigation, search

Contents

JSON

About

What is it?

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. - JSON.org

What is it useful for?

JSON can be used to transmit data rapidly between client and server or an external source. Do not confuse JSON with Remote Scripting. JSON is a data-interchange format. Remote Scripting is a way to get script functions from an external source. Remote Scripting is a problematic approach at best and can open you up to cross site scripting attacks (XSS).

Use JSON when XML is not appropriate. Client browsers shouldn't have to parse XML unecessarily. If you are getting data from an in-house web application, and you are using XML, you are more than likely shooting yourself in the foot. XML is time consuming to generate server-side and time consuming to parse client-side. In addition, code to generate and parse XML is generally more time consuming to write than code to handle JSON.

Frameworks/Toolkits

Server

Jayrock

Client

dojo

Personal tools