Skip to content

Instantly share code, notes, and snippets.

@fisherds
Last active August 29, 2015 14:08
Show Gist options
  • Select an option

  • Save fisherds/a8d438d30cc9e3cf3489 to your computer and use it in GitHub Desktop.

Select an option

Save fisherds/a8d438d30cc9e3cf3489 to your computer and use it in GitHub Desktop.
Skeleton code for a jQuery post from our ServerTime demo
var dataToSend = {};
$.post( "/servertime", dataToSend ).done(function( data ) {
console.log("Response JSON: " + JSON.stringify(data));
// TODO: Do something with the data
}).fail(function(jqxhr, textStatus, error) {
console.log("POST Request Failed: " + textStatus + ", " + error);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment