Skip to content

Instantly share code, notes, and snippets.

@mcr
Created February 17, 2015 19:54
Show Gist options
  • Save mcr/58aafeb019f18a3cd6b8 to your computer and use it in GitHub Desktop.
Save mcr/58aafeb019f18a3cd6b8 to your computer and use it in GitHub Desktop.
$.ajax({ "url": agenda_url,
"type": "POST",
"data": { "public" : new_value },
"dataType": "json",
"success": function(result) {
/* result is a json object */
value = result["public"];
log("new value "+value);
$(span_to_replace).html(value);
}});
@mcr
Copy link
Author

mcr commented Feb 17, 2015

var pinned_update = $.ajax(this.href, {
    "content-type": "text/json",
    "type": "PUT",
    "data": pinned_struct,
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment