var can = $$('can'); var cans = can.getContext('2d'); window.location=cans.canvas.toDataURL('image/png');