Saturday, May 19, 2018

JSON

What is JSON?

JSON, or JavaScript Object Notation, is a minimal, readable format for structuring data. It is used primarily to transmit data between a server and web application, as an alternative to XML. Squarespace uses JSON to store and organize site content created with the CMS.

Example

Append ?format=json-pretty to the URL of any page on your Squarespace site and you'll be able to view the JSON data for the site.

Keys and Values

The two primary parts that make up JSON are keys and values. Together they make a key/value pair.
  • Key: A key is always a string enclosed in quotation marks.
  • Value: A value can be a string, number, boolean expression, array, or object.
  • Key/Value Pair: A key value pair follows a specific syntax, with the key followed by a colon followed by the value. Key/value pairs are comma separated.


Types of Values

  • Array: An associative array of values.
  • Boolean: True or false.
  • Number: An integer.
  • Object: An associative array of key/value pairs.
  • String: Several plain text characters which usually form a word.
Numbers, booleans and strings are self-evident, so we'll skip over those sections. Arrays and Objects are explained in more depth below.

2 comments:

  1. Great work did by you. Informative and problem-solving content that users can easily digest can work for all types of blogs. When a user finds something informative on a blog, he/she is more likely to come back from your side.
    Assignment Writing Service Help

    ReplyDelete