title: jQuery-- Populate select from json
body: <p>I have a map in my java sevlet and converting it to a json format that works right.</p>
  
  <p>When I do this function below it creates a drop down, but it puts every character as an option??
  This is what I got:</p>
  
  <pre><code>$(document).ready(function(){
      var temp= '${temp}';
      //alert(options);
      var $select = $('#down');                        
      $select.find('option').remove();                          
      $.each(temp, function(key, value) {              
          $('&lt;option&gt;').val(key).text(value).appendTo($select);     
      });
  });
  </code></pre>
  
  <p>map content in JSON format</p>
  
  <pre><code>{"1" : "string","2" : "string"}
  </code></pre>