title: json get field name
body: <p>I want to push the Field Names into the option value and the result into the text of a select.  It should look like this:</p>
  
  <pre><code>&lt;select id="ddl_fields"&gt;
      &lt;option value="RoleId"&gt;e407d28a&lt;/option&gt;
      &lt;option value="RoleName"&gt;Sales&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>This is the json object returned from the database:</p>
  
  <pre><code>"[{"RoleId":"e407d28a","RoleName":"Sales"}]"
  </code></pre>
  
  <p>This is the code and it pulls back a valid result:</p>
  
  <pre><code>function getFields(){
          var the_id = $(".hid_ID").val();
          var jsonText = JSON.stringify({ id: the_id });
          $.ajax({
              type: "POST",
              url: "bc_Admin.aspx/getFields",
              data: jsonText,
              contentType: "application/json; charset=utf-8",
              dataType: "json",
              success: function (data) {
                  if (data.d != "0") {
                      var obj = $.parseJSON(data.d);
                       //what needs to change???
                      $.each(obj, function (index, value) {
                          $('#ddl_fields')
                          .append($("&lt;option value=" + value.id_Role + "&gt;" + value.RoleName + "&lt;/option&gt;"));
                      });
                  }
              } //end success
          });
      }
  </code></pre>
  
  <p>Similar to this questions but need a JQuery solution.
  <a href="https://stackoverflow.com/questions/7370828/how-to-get-list-all-field-names-of-a-json-data-with-extjs">How to get/list all field names of a JSON data with ExtJS?</a></p>
  
  <p>Thanks!</p>