Created
January 17, 2013 02:59
-
-
Save jzerbe/4553151 to your computer and use it in GitHub Desktop.
use a previously initialized CORS XHR object to POST a JSON payload
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 postCorsRequest(theUrl, theJsonObj, theOnLoadCallback, theErrorCallback) { | |
var aJsonStr = JSON.stringify(theJsonObj); | |
var aRequest = createCorsRequest("post", theUrl); | |
if (aRequest) { | |
aRequest.onload = theOnLoadCallback; | |
aRequest.onerror = theErrorCallback; | |
aRequest.send(aJsonStr); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment