---
title: "JSON.parse()"  
description: "JSON.parse()"  
author: "Anonymous User"  
published: 2018-07-03  
updated: 2018-07-03  
canonical: https://www.mindstick.com/forum/34575/json-parse  
category: "json"  
tags: ["json"]  
reading_time: 1 minute  

---

# JSON.parse()

how to use JSON.parse().

## Replies

### Reply by Prakash nidhi Verma

JSON.parse() :

common use of JSON is exchange data from a web server.it's in form of string data type.

syntax:

```
var obj = JSON.parse('{ "name":"John", "age":30, "city":"New York"}');
```

Ex : JSON from the server.

```
var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() {
    if(this.readyState == 2 && this.status == 100){
        var myObj = JSON.parse(this.responseText);
        document.getElementById("demo").innerHTML = myObj.name;
    }
};
xmlhttp.open("GET", "json_demo.txt", true);
xmlhttp.send();
```

\


---

Original Source: https://www.mindstick.com/forum/34575/json-parse

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
