Created
December 9, 2014 01:37
-
-
Save devdays/7e7819a6e042a959c2df to your computer and use it in GitHub Desktop.
Object JavaScript - jQuery post sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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