{"id":5199,"date":"2019-04-20T05:56:46","date_gmt":"2019-04-20T05:56:46","guid":{"rendered":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?p=5199"},"modified":"2022-11-24T13:00:31","modified_gmt":"2022-11-24T13:00:31","slug":"what-is-json","status":"publish","type":"post","link":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/what-is-json\/","title":{"rendered":"What Is JSON? Everything That You Need To Know About It"},"content":{"rendered":"<p>JavaScript Object Notation (JSON) is an open-standard file format, used to exchange information that is readable to humans. This file contains only text and uses the extension .json.<br \/>\nIt is a lightweight format used for storing and transporting data between a server and web application, as an alternative to the XML. In simple words, JSON gives a human-readable collection of data that we are able to access in a logical manner.<\/p>\n<h2>Usage of JSON &#8211;<\/h2>\n<p>Most of the developers use JSON so as to work with AJAX (Asynchronous JavaScript and XML). Both these formats work well together in order to provide you the asynchronous loading of stored data that simply means, the website can update its information without refreshing the page.<br \/>\nThis format is often used to serialize and transmit structured data over a network connection.<br \/>\nIt also allows users to request data from a different domain with the help of a method called as JSON by using (&lt;script&gt;)&nbsp;) tags. Without this, you cannot transfer data across-domains.<\/p>\n<h2>Structures of JSON &#8211;<\/h2>\n<p>JSON is built on two structures :<br \/>\n(i) A collection of name\/value pairs. In most of the languages, this is known as an object, record, dictionary, struct, hash table, keyed list or an associate array.<\/p>\n<p>(ii) An ordered list of values. In most of the languages, this is known as an array, vector, list, or sequence.<\/p>\n<p><strong>Related:&nbsp; <a href=\"https:\/\/www.milesweb.co.uk\/blog\/hosting\/cloud\/shift-java-applications-milesweb-paas-containers\/\">Why Should You Shift Your Java Applications To MilesWeb PaaS Containers?<\/a><\/strong><\/p>\n<h3>JSON syntax rules :<\/h3>\n<p>(i) Data is always in key\/value pair.<br \/>\n(ii) Data is always separated by commas.<br \/>\n(iii) Curly braces hold objects.<br \/>\n(iv) Square brackets hold arrays.<\/p>\n<p>Example : &#8220;gender&#8221; : &#8220;male&#8221;<br \/>\nHere: key (name) = gender and<br \/>\nvalue = male<\/p>\n<h3>Different types of Values are :<\/h3>\n<p><strong>(i) Array &#8211; Array of values<\/strong><\/p>\n<p>e.g :<\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">\"students\":[\n{\"firstName\": \"Jack\", \"lastName\": \"Timothy\"},\n{\"firstName\": \"Sam\", \"lastName\": \"Green\"}\n]<\/pre>\n<p>Or<\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">{\n\"firstName\" : \"Jack\",\n\"lastName\" : \"Timothy\",\n\"gender\" : \"male\",\n\"hobby\" : [\"football\", \"painting\", \"swimming']\n}<\/pre>\n<p><strong>Note:<\/strong> Difference here is that, the key Hobby has several values (football, painting, swimming) mentioned in a square brackets, which represents any array.<\/p>\n<p><strong>(ii) Boolean &#8211; True or False<\/strong><\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">{\"sale\" : \"false\"}<\/pre>\n<p><strong>(iii) Number &#8211; An integer<\/strong><\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">{\"age\" : \"25\"}<\/pre>\n<p><strong>(iv) Object &#8211; It is an associate array of key\/value pairs<\/strong><\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">{\n\"id\" : \"48\",\n\"language\" : \"Java\",\n\"price\" : 500,\n}<\/pre>\n<p><strong>(v) String &#8211; Several plain characters that usually form a word<\/strong><\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">\"firstName\" : \"Jack\"<\/pre>\n<p>If you want to store JSON data, there are two way to accomplish it. First is objects and the next one is arrays. In this section, we will discuss more about them below.<\/p>\n<h3>Using Objects<\/h3>\n<p>Curly brackets begin and end a JSON object. Comma-separated lines contain key\/value pairs called properties. Each key and value are separated by a colon.<\/p>\n<p>Strings are required for keys, but numbers, objects, arrays, booleans, and nulls are allowed for values.<\/p>\n<p>There is a difference between JSON objects and objects in the JSON data type. Arrays of key-value pairs serve as a storage method, while associative arrays represent key-value pairs.<\/p>\n<p>Now for your convenience, let\u2019s take the example of three keys, Name, roll number and class with values like Thomas, 24 and 7 A.<\/p>\n<p><em><strong>{<\/strong><\/em><\/p>\n<p><em><strong>&#8220;Name&#8221;:&#8221;Thomas&#8221;,<\/strong><\/em><\/p>\n<p><em><strong>&#8220;rollnumber&#8221;:&#8221;24&#8243;,<\/strong><\/em><\/p>\n<p><em><strong>&#8220;Class&#8221;:&#8221;7A&#8221;<\/strong><\/em><\/p>\n<p><em><strong>}<\/strong><\/em><\/p>\n<h3>Using Arrays<\/h3>\n<p>The use of arrays is another method of storing data. Each line is separated by a comma, with the values enclosed in square brackets. It is possible to have different types of values in JSON arrays.<\/p>\n<p>As opposed to arrays as values, JSON arrays are collections of elements that are typically all the same type.<\/p>\n<p>Let\u2019s have an overview as an example:<\/p>\n<p><strong>{<\/strong><\/p>\n<p><strong>&#8220;Name&#8221;:&#8221;Thomas\u201d,<\/strong><\/p>\n<p><strong>&#8221; rollnumber &#8220;:\u201d24\u201d,<\/strong><\/p>\n<p><strong>&#8220;Class&#8221;:&#8221;7A\u201d,<\/strong><\/p>\n<p><strong>&#8220;subjects&#8221;: [<\/strong><\/p>\n<p><strong>\u201cenglish&#8221;,<\/strong><\/p>\n<p><strong>&#8220;science&#8221;,<\/strong><\/p>\n<p><strong>&#8220;maths&#8221;<\/strong><\/p>\n<p><strong>]<\/strong><\/p>\n<p><strong>}<\/strong><\/p>\n<h4>What Differs Both?<\/h4>\n<p>The fourth key\/value pair differentiates this method from the previous one. The key is subjects, and there are several values in the square brackets (english, science, maths).<\/p>\n<p>When paired with JSONP, arrays can be used to overcome cross-domain issues. Furthermore, they support loops, allowing users to run repeated commands to look up data faster.<\/p>\n<p><strong>Conclusion &#8211;<\/strong><\/p>\n<p>From the above examples, you might have understood that JSON is a useful tool that can be used to interchange data in a manner that can easily be understood by humans.<\/p>\n<p>It can load information asynchronously so that, your website becomes more responsive and can handle the data stream more easily. Also, JSON is easy and lightweight than XML.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>JavaScript Object Notation (JSON) is an open-standard file format, used to exchange information that is readable to humans. This file contains only text and uses the extension .json. It is a lightweight format used for storing and transporting data between a server and web application, as an alternative to the XML. In simple words, JSON [&hellip;]<\/p>\n","protected":false},"author":18,"featured_media":5200,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[459,626,627],"class_list":["post-5199","post","type-post","status-publish","format-standard","has-post-thumbnail","placeholder-for-hentry","category-web-hosting-faq","tag-javascript","tag-json","tag-web-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What Is JSON? Everything That You Need To Know About It<\/title>\n<meta name=\"description\" content=\"JSON stands for JavaScript Object Notation. This article will make it simple for you to know in and out about it.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/what-is-json\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What Is JSON? Everything That You Need To Know About It\" \/>\n<meta property=\"og:description\" content=\"JSON stands for JavaScript Object Notation. This article will make it simple for you to know in and out about it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/what-is-json\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2019-04-20T05:56:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-24T13:00:31+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/04\/JSON.png\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"445\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Sonam Wagh\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sonam Wagh\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/what-is-json\/\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/what-is-json\/\",\"name\":\"What Is JSON? Everything That You Need To Know About It\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/what-is-json\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/what-is-json\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/04\/JSON.png\",\"datePublished\":\"2019-04-20T05:56:46+00:00\",\"dateModified\":\"2022-11-24T13:00:31+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4\"},\"description\":\"JSON stands for JavaScript Object Notation. This article will make it simple for you to know in and out about it.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/what-is-json\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/what-is-json\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/what-is-json\/#primaryimage\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/04\/JSON.png\",\"contentUrl\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/04\/JSON.png\",\"width\":800,\"height\":445,\"caption\":\"JSON\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/what-is-json\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What Is JSON? Everything That You Need To Know About It\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4\",\"name\":\"Sonam Wagh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9cb2cf6ae11d7625ef6417ef8e84ba25?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9cb2cf6ae11d7625ef6417ef8e84ba25?s=96&d=blank&r=g\",\"caption\":\"Sonam Wagh\"},\"description\":\"With an interest in doing something creative daily, Sonam works as a Digital Marketing Executive. She likes to write technical blogs related to web hosting, digital marketing, and other IT topics. She also likes to spend her leisure time on social media to find different strategies for client engagement.\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/sonam\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What Is JSON? Everything That You Need To Know About It","description":"JSON stands for JavaScript Object Notation. This article will make it simple for you to know in and out about it.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/what-is-json\/","og_locale":"en_GB","og_type":"article","og_title":"What Is JSON? Everything That You Need To Know About It","og_description":"JSON stands for JavaScript Object Notation. This article will make it simple for you to know in and out about it.","og_url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/what-is-json\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2019-04-20T05:56:46+00:00","article_modified_time":"2022-11-24T13:00:31+00:00","og_image":[{"width":800,"height":445,"url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/04\/JSON.png","type":"image\/png"}],"author":"Sonam Wagh","twitter_misc":{"Written by":"Sonam Wagh","Estimated reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/what-is-json\/","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/what-is-json\/","name":"What Is JSON? Everything That You Need To Know About It","isPartOf":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/what-is-json\/#primaryimage"},"image":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/what-is-json\/#primaryimage"},"thumbnailUrl":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/04\/JSON.png","datePublished":"2019-04-20T05:56:46+00:00","dateModified":"2022-11-24T13:00:31+00:00","author":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4"},"description":"JSON stands for JavaScript Object Notation. This article will make it simple for you to know in and out about it.","breadcrumb":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/what-is-json\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.co.uk\/hosting-faqs\/what-is-json\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/what-is-json\/#primaryimage","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/04\/JSON.png","contentUrl":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-content\/uploads\/2019\/04\/JSON.png","width":800,"height":445,"caption":"JSON"},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/what-is-json\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"What Is JSON? Everything That You Need To Know About It"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4","name":"Sonam Wagh","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9cb2cf6ae11d7625ef6417ef8e84ba25?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9cb2cf6ae11d7625ef6417ef8e84ba25?s=96&d=blank&r=g","caption":"Sonam Wagh"},"description":"With an interest in doing something creative daily, Sonam works as a Digital Marketing Executive. She likes to write technical blogs related to web hosting, digital marketing, and other IT topics. She also likes to spend her leisure time on social media to find different strategies for client engagement.","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/sonam\/"}]}},"views":634,"_links":{"self":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/5199","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=5199"}],"version-history":[{"count":4,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/5199\/revisions"}],"predecessor-version":[{"id":14494,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/5199\/revisions\/14494"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/media\/5200"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=5199"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=5199"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=5199"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}