Basic HTML: How to Read JSON of Data – Where Do I Start? or Struggling with Basic HTML – How to Read

18 Replies, 590 Views

For basic html how to read json of data, you’re outta luck with just HTML. JavaScript is mandatory.

Quick hack: If you’re *super* new, use CodePen or JSFiddle to play around with JSON + JS without setting up files.

Example:
```javascript
const myJSON = '{"fruit":"apple"}';
const myObj = JSON.parse(myJSON);
alert(myObj.fruit); // Shows "apple"
```

Not elegant, but it’ll help you see how parsing works.

Messages In This Thread



Users browsing this thread: 1 Guest(s)