Last active
December 16, 2015 09:09
-
-
Save stavrossk/5411038 to your computer and use it in GitHub Desktop.
An example of a book list written in JSON.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "book": | |
| [ | |
| { | |
| "id":"01", | |
| "language": "Java", | |
| "edition": "third", | |
| "author": "Herbert Schildt" | |
| } | |
| , | |
| { | |
| "id":"07", | |
| "language": "C++", | |
| "edition": "second" | |
| "author": "E.Balagurusamy" | |
| } | |
| ] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <title> | |
| JSON example | |
| </title> | |
| <script language="javascript" > | |
| var object1 = | |
| { | |
| "language" : "Java", | |
| "author" : "herbert schildt" | |
| }; | |
| document.write("<h1>JSON with JavaScript example</h1>"); | |
| document.write("<br>"); | |
| document.write | |
| ("<h3>Language = " | |
| + object1.language+"</h3>"); | |
| document.write | |
| ("<h3>Author = " | |
| + object1.author+"</h3>"); | |
| var object2 = | |
| { | |
| "language" : "C++", | |
| "author" : "E-Balagurusamy" | |
| }; | |
| document.write("<br>"); | |
| document.write | |
| ("<h3>Language = " | |
| + object2.language | |
| + "</h3>"); | |
| document.write | |
| ("<h3>Author = " | |
| + object2.author | |
| + "</h3>"); | |
| document.write | |
| ("<hr />"); | |
| document.write | |
| (object2.language | |
| + " programming language can be studied " | |
| + "from book written by " | |
| + object2.author); | |
| document.write("<hr />"); | |
| </script> | |
| </head> | |
| <body> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment