I'm using Fabric.js and I've created a fabric canvas object at one place.
var x = new fabric.Canvas("mycanvas");
Now at another place, I want to access this object where 'x' won't be available. So how can I get the same fabric canvas object.
I don't wanna change the scope of x or pass x as arg.
Also, how to get the toDataURL from the fabric canvas object?