Created
June 23, 2010 13:58
-
-
Save blowery/449950 to your computer and use it in GitHub Desktop.
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
function itWorked(response) { console.log("yay!"); } | |
function itFailed(err) { console.error("boo!", err); } | |
// in dojo 1.4+ | |
var theForm = dojo.byId("theForm"); // assumes <form id="theForm"> is what you want | |
var def = dojo.xhrPost({ | |
url: "/send/it/here", | |
rawBody: dojo.formToJson(theForm), | |
contentType: "application/json" | |
}); | |
def.addCallback(itWorked); | |
def.addErrback(itFailed); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment