One option would be to convert the json object into an array (each property would be an element in the array), then sort the array by name, and append it to the select:
var json = {"1":"First","11":"Second","10":"Third"};
var list = new Array();
// insert all the properties and their values into an array of objects
for(var propName in json) {
list.push({ "id": propName, "value":json[propName] });
}
// sort the array using the value instead of the id
list.sort(function compare(a,b) {
if (a.value < b.value)
return -1;
else
return 1; // we consider that if they have the same name, the first one goes first
});
// append the options in order in the select
for (var x = 0; x < list.length; x++) {
$("#mySelect").append("<option value='" + list[x].id + "'>" + list[x].value + "</option>");
}
You can see it working on this jsfiddle.