Skip to content

Instantly share code, notes, and snippets.

@devdays
Created December 9, 2014 01:37
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 devdays/7e7819a6e042a959c2df to your computer and use it in GitHub Desktop.
Save devdays/7e7819a6e042a959c2df to your computer and use it in GitHub Desktop.
Object JavaScript - jQuery post sample
var post = $.ajax({
url: "/echo/json/",
data: {
json: JSON.stringify({firstName: "Jose", lastName: "Romaniello"})
} ,
type: "POST"
});
post.done(function(p){
alert(p.firstName + " saved.");
});
post.fail(function(){
alert("error!");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment