Skip to content

Instantly share code, notes, and snippets.

@blowery
Created June 23, 2010 13:58
Show Gist options
  • Save blowery/449950 to your computer and use it in GitHub Desktop.
Save blowery/449950 to your computer and use it in GitHub Desktop.
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