var preferenceUIs = []; function onLoad() { $.post( "/command/get-all-preferences", null, populatePreferences, "json" ); } $(onLoad); function populatePreferences(prefs) { var body = $("#body").empty(); $('

').text("Preferences").appendTo(body); var table = $('').addClass("preferences").html('').appendTo(body)[0]; for (var k in prefs) { var tr = table.insertRow(table.rows.length); preferenceUIs.push(new PreferenceUI(tr, k, prefs[k])); } var trLast = table.insertRow(table.rows.length); var tdLast0 = trLast.insertCell(0); $('
KeyValue