function
UploadPic() {
// Generate the image data
var
Pic = document.getElementById(
"myCanvas"
).toDataURL(
"image/png"
);
Pic = Pic.replace(/^data:image\/(png|jpg);base64,/,
""
)
// Sending the image data to Server
$.ajax({
type:
'POST'
,
url:
'upload_save.php'
,
data:
Pic
,
contentType:
'application/json; charset=utf-8'
,
dataType:
'json'
,
success:
function
(msg) {
alert(
"Done, Picture Uploaded."
);
}
});
}