title: Javascript Sort Array by Value
body: <p>I have an AJAX call returning JSON like...</p>
  
  <pre><code>{
    490: "A",
    675: "B",
    491: "C",
    520: "D",
    681: "E",
    679: "F",
    538: "G"    
  }
  </code></pre>
  
  <p>I then have it appending to a <code>select</code> using:    </p>
  
  <pre><code>var output = jQuery.parseJSON(data);
  
  $.each(output, function(key, value) {
      $el.append($("&lt;option&gt;&lt;/option&gt;")
         .attr("value", key).text(value));
  });
  </code></pre>
  
  <p>I'd like to sort by the value so the output is <code>A,B,C,D...</code> as right now it just reads in order of the key.</p>
  
  <p><strong>Here's the kicker</strong> - seems to work fine in Firefox, not in Chrome.</p>