title: How can I create this select list from a JSON object using JQuery?
body: <p>Yeah, I have 3 or 4 different answers on the same subject but I'm struggling to combine them to create what I need. I serialize my results using Json.Net which results in the following object:
      </p>
  
  <pre><code>"[  { "Id": 1, "OrderInList": 1  },
      { "Id": 2, "OrderInList": 2  },
      { "Id": 4, "OrderInList": 3  }
  ]"
  </code></pre>
  
  <p>I'd like the option value <em>and</em> text to be the OrderInList value (I'll use the Id with something else later).</p>
  
  <p>I've currently got the following code, but it creates <em>143</em> option boxes. I can see why it's doing it, but I'm not sure how to alter it to get it to work.</p>
  
  <pre><code>    $.getJSON("/Json/GetOrderSelectList?parentCategoryId=" + postData, null, function (jsonResult) {
          $('#orderInList').attr('enabled', 'true');
          $.each(jsonResult, function() {
              $.each(this, function(index, item) {
                                  $('#orderInList').append(
                                      $("&lt;option&gt;&lt;/option&gt;")
                                          .text(index)
                                          .val(index)
                                  );
  
              });
          });
  </code></pre>
  
  <p>Any help would be appreciated!</p>