Skip to content

Instantly share code, notes, and snippets.

@jgv
Created May 24, 2012 20:01
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 jgv/2783870 to your computer and use it in GitHub Desktop.
Save jgv/2783870 to your computer and use it in GitHub Desktop.
send image data across domains
var canvas = document.getElementById("canvas"),
image = canvas.toDataURL("image/png");
$.ajax({
url: "https://app-engine-identifier.appspot.com/upload",
type: "POST",
data: { imgdata : image },
crossDomain: true,
success: function(data){
console.log(data); // yayyy
},
error: function(error){
throw error; // ;_;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment