title: jquery fill dropdown with json data
body: <p>I have the following jQuery code. I am able to get the following data from server <code>[{"value":"1","label":"xyz"}, {"value":"2","label":"abc"}]</code>. How do I iterate over this and fill a select box with <code>id=combobox</code></p>
  
  <pre><code>$.ajax({
      type: 'POST',
      url: "&lt;s:url value="/ajaxMethod.action"/&gt;",
      data:$("#locid").serialize(),
      success: function(data) {
          alert(data.msg);
  
                  //NEED TO ITERATE data.msg AND FILL A DROP DOWN
      },
      error: function(XMLHttpRequest, textStatus, errorThrown) {
          alert(textStatus);
      },
      dataType: "json"
  });
  </code></pre>
  
  <p>Also what is the difference between using <code>.ajax</code> and <code>$.getJSON</code>.</p>