title: get json array objects in javascript
body: <p>Hi how to get json array elements in different ids in response?</p>
  
  <p>//server side jsp</p>
  
  <pre><code> &lt;%@page import="net.sf.json.JSONObject"%&gt;
  &lt;%@page import="net.sf.json.JSONArray"%&gt;
  &lt;%
    JSONArray arrayObj=new JSONArray();               
   JSONObject obj=new JSONObject();
   obj.put("name","data");// how can i display string "name" in secondcombobox id?
   obj.put("roll_no","data"); how can i display string "roll_no" in thirdcombobox id?
   out.println(obj.toString());
  %&gt;
  </code></pre>
  
  <p>client side jsp where retrieving json array elements in javascript</p>
  
  <pre><code> $("#firstcombo").change(function() {
   $.get('comboboxpage.jsp', { combo1Val : $(this).val() }, function(responseData) {
   $("#secondcomboboxid").replaceWith(data.name);// here i want to display name, how can i do it?
   $("#thirdcomboboxid").replaceWith(data.roll_no);// here i want to display roll no, how can i do it?
  });
  });
  
  &lt;input type="text" id="secondcomboboxid" name="secondcomboboxid"/&gt;// how can i show name here?
  &lt;input type="text" id="thirdcomboboxid" name="thirdcomboboxid"/&gt; how can i show roll_no here?
  </code></pre>
  
  <p>How can i display <strong>name</strong> in <strong>secondcomboboxid</strong> and <strong>roll no</strong> in <strong>thirdcomboboxid</strong>? I googled a lot but could not find any solution, Any ideas please</p>