title: Fabric.js - how to give a callback for canvas loaded event
body: <p>I load my canvas from a JSON object and call <code>toDataURL</code> but I need a callback which will be executed after canvas loaded because if there is image on canvas, <code>toDataURL</code> function returns a blank page since it's called before image is loaded.</p>
  
  <pre><code> canvas.loadFromJSON(json);
  
   // I need an event handler here which will be executed after canvas is loaded
  
   var dataURL = canvas.toDataURL();
  </code></pre>