{"id":194,"date":"2024-02-29T17:37:51","date_gmt":"2024-02-29T17:37:51","guid":{"rendered":"https:\/\/www.xopsschool.com\/tutorials\/?p=194"},"modified":"2024-02-29T17:39:26","modified_gmt":"2024-02-29T17:39:26","slug":"define-a-json-file","status":"publish","type":"post","link":"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/","title":{"rendered":"Define a JSON file?"},"content":{"rendered":"\n<p>JSON (JavaScript Object Notation) is an open standard file format for sharing data that uses human-readable text to store and transmit data. JSON files are stored with the .json extension. JSON requires less formatting and is a good alternative for XML. JSON is derived from JavaScript but is a language-independent data format. The generation and parsing of JSON is supported by many modern programming languages. application\/json is the media type used for JSON.<\/p>\n\n\n\n<p><strong>Why is JSON used?<\/strong><\/p>\n\n\n\n<p>JSON is used in JavaScript on the internet as an alternative to XML for organizing data. JSON is language-independent and can be combined with C++, Java, Python and many other languages. Unlike XML, which is a full markup language, JSON is simply a way to represent data structures. JSON documents are relatively lightweight and are rapidly executed on web servers.<\/p>\n\n\n\n<p><strong>Characteristics of JSON<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>JSON is easy to read and write.<\/li>\n\n\n\n<li>It is a lightweight text-based interchange format.<\/li>\n\n\n\n<li>JSON is language independent.<\/li>\n<\/ul>\n\n\n\n<p><strong>Example in JSON<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\r\n \"book\": &#91;\r\n {\r\n \"id\":\"01\",\r\n \"language\": \"Java\",\r\n \"edition\": \"third\",\r\n \"author\": \"Herbert Schildt\"\r\n },\r\n {\r\n \"id\":\"07\",\r\n \"language\": \"C++\",\r\n \"edition\": \"second\"\r\n \"author\": \"E.Balagurusamy\"\r\n }]\r\n}\r\n\r\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">JSON HTML CODE<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;html>\r\n&lt;head>\r\n&lt;title>JSON example&lt;\/title>\r\n&lt;script language=\"javascript\" >\r\n\r\n var object1 = { \"language\" : \"Java\", \"author\" : \"herbert schildt\" };\r\n document.write(\"&lt;h1>JSON with JavaScript example&lt;\/h1>\");\r\n document.write(\"&lt;br>\");\r\n document.write(\"&lt;h3>Language = \" + object1.language+\"&lt;\/h3>\");\r\n document.write(\"&lt;h3>Author = \" + object1.author+\"&lt;\/h3>\");\r\n var object2 = { \"language\" : \"C++\", \"author\" : \"E-Balagurusamy\" };\r\n document.write(\"&lt;br>\");\r\n document.write(\"&lt;h3>Language = \" + object2.language+\"&lt;\/h3>\");\r\n document.write(\"&lt;h3>Author = \" + object2.author+\"&lt;\/h3>\");\r\n\r\ndocument.write(\"&lt;hr \/>\");\r\ndocument.write(object2.language + \" programming language can be studied \" +\r\n\"from book written by \" + object2.author);\r\ndocument.write(\"&lt;hr \/>\");\r\n\r\n&lt;\/script>\r\n&lt;\/head>\r\n&lt;body>\r\n&lt;\/body>\r\n&lt;\/html>\n\n<strong>OUTPUT<\/strong> <strong>:-<\/strong>\n\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.xopsschool.com\/tutorials\/wp-content\/uploads\/2024\/02\/Screenshot-53-1024x576.png\" alt=\"\" class=\"wp-image-195\" style=\"width:750px;height:auto\" srcset=\"https:\/\/www.xopsschool.com\/tutorials\/wp-content\/uploads\/2024\/02\/Screenshot-53-1024x576.png 1024w, https:\/\/www.xopsschool.com\/tutorials\/wp-content\/uploads\/2024\/02\/Screenshot-53-300x169.png 300w, https:\/\/www.xopsschool.com\/tutorials\/wp-content\/uploads\/2024\/02\/Screenshot-53-768x432.png 768w, https:\/\/www.xopsschool.com\/tutorials\/wp-content\/uploads\/2024\/02\/Screenshot-53-1280x720.png 1280w, https:\/\/www.xopsschool.com\/tutorials\/wp-content\/uploads\/2024\/02\/Screenshot-53.png 1366w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">JSON Syntax  <\/h2>\n\n\n\n<p>JSON (JavaScript Object Notation) has a simple and easy-to-read syntax. Here are the basic syntax rules<\/p>\n\n\n\n<p><strong>Json Syntax Rules<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Data is represented as key-value pairs enclosed in curly braces {}.<\/li>\n\n\n\n<li>Keys and strings are enclosed in double-quotes.<\/li>\n\n\n\n<li>Values can be strings, numbers, objects, arrays, booleans, or null.<\/li>\n\n\n\n<li>Multiple key-value pairs are separated by commas.<\/li>\n<\/ul>\n\n\n\n<p>JSON supports several data types, and each data type serves a specific purpose. Here are the main JSON data types.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"634\" height=\"431\" src=\"https:\/\/www.xopsschool.com\/tutorials\/wp-content\/uploads\/2024\/02\/Screenshot-55.png\" alt=\"\" class=\"wp-image-196\" srcset=\"https:\/\/www.xopsschool.com\/tutorials\/wp-content\/uploads\/2024\/02\/Screenshot-55.png 634w, https:\/\/www.xopsschool.com\/tutorials\/wp-content\/uploads\/2024\/02\/Screenshot-55-300x204.png 300w\" sizes=\"auto, (max-width: 634px) 100vw, 634px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>JSON (JavaScript Object Notation) is an open standard file format for sharing data that uses human-readable text to store and transmit data. JSON files are stored with the .json extension. JSON requires less formatting and is a good alternative for XML. JSON is derived from JavaScript but is a language-independent data format. The generation and &#8230; <a title=\"Define a JSON file?\" class=\"read-more\" href=\"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/\" aria-label=\"Read more about Define a JSON file?\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-194","post","type-post","status-publish","format-standard","hentry","category-define-json-file"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Define a JSON file? - XOps Tutorials!!!<\/title>\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.xopsschool.com\/tutorials\/define-a-json-file\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Define a JSON file? - XOps Tutorials!!!\" \/>\n<meta property=\"og:description\" content=\"JSON (JavaScript Object Notation) is an open standard file format for sharing data that uses human-readable text to store and transmit data. JSON files are stored with the .json extension. JSON requires less formatting and is a good alternative for XML. JSON is derived from JavaScript but is a language-independent data format. The generation and ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/\" \/>\n<meta property=\"og:site_name\" content=\"XOps Tutorials!!!\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-29T17:37:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-29T17:39:26+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.xopsschool.com\/tutorials\/wp-content\/uploads\/2024\/02\/Screenshot-53-1024x576.png\" \/>\n<meta name=\"author\" content=\"ritik hansda\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"ritik hansda\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/\"},\"author\":{\"name\":\"ritik hansda\",\"@id\":\"https:\/\/www.xopsschool.com\/tutorials\/#\/schema\/person\/c0119ddd2d27ea9cd476e809c8294ba7\"},\"headline\":\"Define a JSON file?\",\"datePublished\":\"2024-02-29T17:37:51+00:00\",\"dateModified\":\"2024-02-29T17:39:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/\"},\"wordCount\":244,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.xopsschool.com\/tutorials\/wp-content\/uploads\/2024\/02\/Screenshot-53-1024x576.png\",\"articleSection\":[\"Define Json File\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/\",\"url\":\"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/\",\"name\":\"Define a JSON file? - XOps Tutorials!!!\",\"isPartOf\":{\"@id\":\"https:\/\/www.xopsschool.com\/tutorials\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.xopsschool.com\/tutorials\/wp-content\/uploads\/2024\/02\/Screenshot-53-1024x576.png\",\"datePublished\":\"2024-02-29T17:37:51+00:00\",\"dateModified\":\"2024-02-29T17:39:26+00:00\",\"author\":{\"@id\":\"https:\/\/www.xopsschool.com\/tutorials\/#\/schema\/person\/c0119ddd2d27ea9cd476e809c8294ba7\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/#primaryimage\",\"url\":\"https:\/\/www.xopsschool.com\/tutorials\/wp-content\/uploads\/2024\/02\/Screenshot-53.png\",\"contentUrl\":\"https:\/\/www.xopsschool.com\/tutorials\/wp-content\/uploads\/2024\/02\/Screenshot-53.png\",\"width\":1366,\"height\":768},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.xopsschool.com\/tutorials\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Define a JSON file?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.xopsschool.com\/tutorials\/#website\",\"url\":\"https:\/\/www.xopsschool.com\/tutorials\/\",\"name\":\"XOps Tutorials!!!\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.xopsschool.com\/tutorials\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.xopsschool.com\/tutorials\/#\/schema\/person\/c0119ddd2d27ea9cd476e809c8294ba7\",\"name\":\"ritik hansda\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.xopsschool.com\/tutorials\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/6fe0bc437410899c524975272622377e50e726108b1ad03f7b4488f734304fce?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/6fe0bc437410899c524975272622377e50e726108b1ad03f7b4488f734304fce?s=96&d=mm&r=g\",\"caption\":\"ritik hansda\"},\"url\":\"https:\/\/www.xopsschool.com\/tutorials\/author\/ritikhansda\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Define a JSON file? - XOps Tutorials!!!","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.xopsschool.com\/tutorials\/define-a-json-file\/","og_locale":"en_US","og_type":"article","og_title":"Define a JSON file? - XOps Tutorials!!!","og_description":"JSON (JavaScript Object Notation) is an open standard file format for sharing data that uses human-readable text to store and transmit data. JSON files are stored with the .json extension. JSON requires less formatting and is a good alternative for XML. JSON is derived from JavaScript but is a language-independent data format. The generation and ... Read more","og_url":"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/","og_site_name":"XOps Tutorials!!!","article_published_time":"2024-02-29T17:37:51+00:00","article_modified_time":"2024-02-29T17:39:26+00:00","og_image":[{"url":"https:\/\/www.xopsschool.com\/tutorials\/wp-content\/uploads\/2024\/02\/Screenshot-53-1024x576.png","type":"","width":"","height":""}],"author":"ritik hansda","twitter_card":"summary_large_image","twitter_misc":{"Written by":"ritik hansda","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/#article","isPartOf":{"@id":"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/"},"author":{"name":"ritik hansda","@id":"https:\/\/www.xopsschool.com\/tutorials\/#\/schema\/person\/c0119ddd2d27ea9cd476e809c8294ba7"},"headline":"Define a JSON file?","datePublished":"2024-02-29T17:37:51+00:00","dateModified":"2024-02-29T17:39:26+00:00","mainEntityOfPage":{"@id":"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/"},"wordCount":244,"commentCount":0,"image":{"@id":"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/#primaryimage"},"thumbnailUrl":"https:\/\/www.xopsschool.com\/tutorials\/wp-content\/uploads\/2024\/02\/Screenshot-53-1024x576.png","articleSection":["Define Json File"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/","url":"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/","name":"Define a JSON file? - XOps Tutorials!!!","isPartOf":{"@id":"https:\/\/www.xopsschool.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/#primaryimage"},"image":{"@id":"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/#primaryimage"},"thumbnailUrl":"https:\/\/www.xopsschool.com\/tutorials\/wp-content\/uploads\/2024\/02\/Screenshot-53-1024x576.png","datePublished":"2024-02-29T17:37:51+00:00","dateModified":"2024-02-29T17:39:26+00:00","author":{"@id":"https:\/\/www.xopsschool.com\/tutorials\/#\/schema\/person\/c0119ddd2d27ea9cd476e809c8294ba7"},"breadcrumb":{"@id":"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/#primaryimage","url":"https:\/\/www.xopsschool.com\/tutorials\/wp-content\/uploads\/2024\/02\/Screenshot-53.png","contentUrl":"https:\/\/www.xopsschool.com\/tutorials\/wp-content\/uploads\/2024\/02\/Screenshot-53.png","width":1366,"height":768},{"@type":"BreadcrumbList","@id":"https:\/\/www.xopsschool.com\/tutorials\/define-a-json-file\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.xopsschool.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Define a JSON file?"}]},{"@type":"WebSite","@id":"https:\/\/www.xopsschool.com\/tutorials\/#website","url":"https:\/\/www.xopsschool.com\/tutorials\/","name":"XOps Tutorials!!!","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.xopsschool.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.xopsschool.com\/tutorials\/#\/schema\/person\/c0119ddd2d27ea9cd476e809c8294ba7","name":"ritik hansda","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.xopsschool.com\/tutorials\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6fe0bc437410899c524975272622377e50e726108b1ad03f7b4488f734304fce?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6fe0bc437410899c524975272622377e50e726108b1ad03f7b4488f734304fce?s=96&d=mm&r=g","caption":"ritik hansda"},"url":"https:\/\/www.xopsschool.com\/tutorials\/author\/ritikhansda\/"}]}},"_links":{"self":[{"href":"https:\/\/www.xopsschool.com\/tutorials\/wp-json\/wp\/v2\/posts\/194","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xopsschool.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xopsschool.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xopsschool.com\/tutorials\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xopsschool.com\/tutorials\/wp-json\/wp\/v2\/comments?post=194"}],"version-history":[{"count":1,"href":"https:\/\/www.xopsschool.com\/tutorials\/wp-json\/wp\/v2\/posts\/194\/revisions"}],"predecessor-version":[{"id":197,"href":"https:\/\/www.xopsschool.com\/tutorials\/wp-json\/wp\/v2\/posts\/194\/revisions\/197"}],"wp:attachment":[{"href":"https:\/\/www.xopsschool.com\/tutorials\/wp-json\/wp\/v2\/media?parent=194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xopsschool.com\/tutorials\/wp-json\/wp\/v2\/categories?post=194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xopsschool.com\/tutorials\/wp-json\/wp\/v2\/tags?post=194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}