js canvas to data url code example
Example 1: javascript todataurl
var image = new Image();
image.src = canvas.toDataURL();
Example 2: get image url from canvas
var dataURL = canvas.toDataURL();
var image = new Image();
image.src = canvas.toDataURL();
var dataURL = canvas.toDataURL();