title: error while parsing Json in javascript
body: <p>This seems to be a very basic question, but it took my couple of hours as i am not much aware of javascript and jquery.</p>
  
  <p>Well, i need to parse the Json string and get the value of particular key.
  Json looks like: <code>{"currentCT":"Brijesh"}</code></p>
  
  <p>I tried <code>eval()</code> and <code>parse()</code> but it seems i am missing something and i am not able to trace the issue.</p>
  
  <p>I tried:</p>
  
  <pre><code>pre.innerHTML = eval('(' + res + ')');
  </code></pre>
  
  <p>and </p>
  
  <pre><code>pre.innerHTML = JSON.parse(res);
  </code></pre>
  
  <p>Both are not working for me.</p>
  
  <p><strong>Output</strong>
  Both methods returns <code>[object Object]</code></p>
  
  <p>Point out my mistake</p>
  
  <p><strong>EDIT</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function findTeacher() {
          var url = "/TemplateTest/add/findclassteacher.action?";
          var standard = document.getElementById("classes_widget");
          var val_standard = "standard="
                  + standard.options[standard.selectedIndex].value;
          url = url + val_standard + "&amp;";
          var section = document.getElementById("sections_widget");
          var val_section = "section="
                  + section.options[section.selectedIndex].value;
          url = url + val_section;
          var xmlhttp;
          if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
              xmlhttp = new XMLHttpRequest();
          } else {// code for IE6, IE5
              xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
          }
          xmlhttp.onreadystatechange = function() {
              if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) {
                  var res = xmlhttp.responseText;
                  var pre = document.getElementById("holder");
                  pre.innerHTML = JSON.parse(res);
                  pre.innerHTML = eval('(' + res + ')');
              }
          }
          xmlhttp.open("GET", url, true);
          xmlhttp.send();
  
      }
  &lt;/script&gt;
  </code></pre>