Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Send the drawn image to the server
  2. $('#sendBtn').live('click', function () {
  3.     var cvs = $('#canvas');
  4.     var image = cvs[0].toDataURL("image/png");
  5.     image = image.replace('data:image/png;base64,', '');
  6.  
  7.     $.ajax({
  8.         type: 'POST',
  9.         url: '/webcam_demo/handle_image/',
  10.         data: '{ "part_picture" : "' + image + '" }',
  11.         contentType: 'application/json; charset=utf-8',
  12.         dataType: 'json',
  13.         success: function (msg) {
  14.             alert('Image sent!');
  15.         }
  16.     });
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement