File "canvas.js"

Full Path: C:/wamp64/www/APPSST/js/canvas.js
File size: 608 bytes
MIME-type: text/plain
Charset: utf-8

$(document).ready(function() {
    $(document).on('click', '#sendBtn', function() {
      var Pic = document.getElementById("canvas").toDataURL("image/jpg");
      Pic = Pic.replace(/^data:image\/(png|jpg);base64,/, "")
  
      // Sending the image data to Server
      $.ajax({
        type: 'POST',
        url: 'WebForm2.aspx/UploadPic',
        data: '{ "imageData" : "' + Pic + '" }',
        contentType: 'application/json; charset=utf-8',
        dataType: 'json',
        success: function(msg) {
          alert("Done, Picture Uploaded.");
        }
      });
    });
  });