title: JSON string parsing in Javascript
body: <p>I have some JSON which has been passed from a servlet and is stored in xmlhttp.responseText. I want to decompose this JSON so that i can have values of data, size, style, name, etc. Also I wish to have the widget value to be in separate variable. </p>
  
  <p>Here is the JSON:</p>
  
  <pre><code>{
    "widget vlaue=2": {
      "debug": "on",
      "window": {
        "title": "Sample Konfabulator Widget",
        "name": "main_window",
        "width": 500,
        "height": 500
      },
    },
    "image": { 
      "src": "Images/Sun.png",
      "name": "sun1",
      "hOffset": 250,
      "vOffset": 250,
      "alignment": "center"
    },
    "text": {
      "data": "Click Here",
      "size": 36,
      "style": "bold",
      "name": "text1",
      "hOffset": 250,
      "vOffset": 100,
      "alignment": "center",
      "onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
    }
  }    
  </code></pre>
  
  <p>I have tried this:</p>
  
  <pre><code>obj = JSON.parse(xmlhttp.responseText); 
  </code></pre>
  
  <p>but this failed. I could not find anything related to it online. Can anyone please help me with this?</p>