I have a canvas drawing that I want to save and download automatically when a button is clicked. I will like to implement it in javascript or ajax as long as the saved data will be downloaded automatically. I do not need to save it to the server...
var canvas = document.getElementsByClassName('whiteboard')[0];
<canvas id='canvas' ></canvas>
<button id="scan" />Save</button>
Thanks