title: ajax json string returning undefined
body: <p>I am using a library of thejit.org, and the graph is space tree.</p>
  <pre><code>st.onClick(node.id, {
     Move: {
     enable: true,
     offsetX: 30,
     offsetY: 5
     },
     onComplete: function() {
      $.ajax({
  
       type: &quot;POST&quot;,
      url: &quot;Home&quot;,
      data: &quot;node=&quot;+node.id,
      dataType: &quot;json&quot;,
      success: function(data) {
  
  st.loadJSON(data.d); //error
  st.compute();
  st.geom.translate(new $jit.Complex(-200, 0), &quot;current&quot;);
  st.onClick(st.root);
  st.refresh();
  }
  </code></pre>
  <p>I am trying to regenerate the graph with a new json once a node is
  clicked. In the onclick function I am making an ajax call, the data if
  printed out is correct. even if iI use the data printed to decalre a
  varialbe and use it. graphs is generated,but when I use it with ajax I
  get undefined.</p>
  <h1>Edit-1</h1>
  <pre><code>JSONObject obj = new JSONObject();
  
  response.setContentType(&quot;application/json; charset=utf-8&quot;);
  
  PrintWriter out = response.getWriter();
  
  String data=    
  &quot;{id:\&quot;90\&quot;,name:\&quot;s\&quot;,data:{},children:[{ id:\&quot;2\&quot;,name:\&quot;2\&quot;,data:{},children:[{ id:\&quot;3\&quot;,name:\&quot;3\&quot;,data:{},children:[]},{ id:\&quot;1265\&quot;,name:\&quot;1265\&quot;,data:{},children:[]}]},{ id:\&quot;8\&quot;,name:\&quot;8\&quot;,data:{},children:[{ id:\&quot;9\&quot;,name:\&quot;9\&quot;,data:{},children:[]},{ id:\&quot;12\&quot;,name:\&quot;12\&quot;,data:{},children:[]}]}]};&quot;;
  
  obj.put(&quot;d&quot;, data);
  
  out.print(obj);
  
  out.flush();
  </code></pre>