Skip to content

Instantly share code, notes, and snippets.

@mythmon
Forked from nobane/callback.js
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mythmon/11155875 to your computer and use it in GitHub Desktop.
Save mythmon/11155875 to your computer and use it in GitHub Desktop.
function display_obj(obj, category) {
var url = "/" + category + "/" + obj.val();
return new Promise(function(resolve, reject) {
$.get(url, function(resp) {
var rows = "";
for (var key in resp) {
console.log("Generating pairs[" + key + "]: " + resp[key]);
rows += generate_row(key, resp[key]);
}
$("#form").empty();
$("#form").html(rows);
$("#message").empty();
resolve(resp);
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment